Instructions to use emozilla/open_llama_7b-scaled with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use emozilla/open_llama_7b-scaled with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="emozilla/open_llama_7b-scaled", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("emozilla/open_llama_7b-scaled", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("emozilla/open_llama_7b-scaled", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use emozilla/open_llama_7b-scaled with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "emozilla/open_llama_7b-scaled" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "emozilla/open_llama_7b-scaled", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/emozilla/open_llama_7b-scaled
- SGLang
How to use emozilla/open_llama_7b-scaled with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "emozilla/open_llama_7b-scaled" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "emozilla/open_llama_7b-scaled", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "emozilla/open_llama_7b-scaled" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "emozilla/open_llama_7b-scaled", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use emozilla/open_llama_7b-scaled with Docker Model Runner:
docker model run hf.co/emozilla/open_llama_7b-scaled
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,9 +7,11 @@ datasets:
|
|
| 7 |
This is a modified version of the original LLaMA model that incorporates Scaled Rotary Embeddings first proposed by [kaiokendev](https://kaiokendev.github.io/). By default, the model is configured to be equivalent to the original OpenLLaMA model (2048 context length). To modify, instantiate the LLaMA configuration and set `max_position_embeddings` to the desired context length. The value should be a power of 2, e.g. 2048, 4096, 8192, etc.
|
| 8 |
|
| 9 |
```python
|
| 10 |
-
config = AutoConfig.from_pretrained("emozilla/open_llama_7b-scaled",
|
|
|
|
| 11 |
config.max_position_embeddings = 8192
|
| 12 |
-
model = AutoModelForCausalLM.from_pretrained("emozilla/open_llama_7b-scaled",
|
|
|
|
| 13 |
```
|
| 14 |
|
| 15 |
You should also set `max_model_length` on your tokenizer.
|
|
|
|
| 7 |
This is a modified version of the original LLaMA model that incorporates Scaled Rotary Embeddings first proposed by [kaiokendev](https://kaiokendev.github.io/). By default, the model is configured to be equivalent to the original OpenLLaMA model (2048 context length). To modify, instantiate the LLaMA configuration and set `max_position_embeddings` to the desired context length. The value should be a power of 2, e.g. 2048, 4096, 8192, etc.
|
| 8 |
|
| 9 |
```python
|
| 10 |
+
config = AutoConfig.from_pretrained("emozilla/open_llama_7b-scaled", \
|
| 11 |
+
trust_remote_code=True)
|
| 12 |
config.max_position_embeddings = 8192
|
| 13 |
+
model = AutoModelForCausalLM.from_pretrained("emozilla/open_llama_7b-scaled", \
|
| 14 |
+
config=config, trust_remote_code=True)
|
| 15 |
```
|
| 16 |
|
| 17 |
You should also set `max_model_length` on your tokenizer.
|