Instructions to use allenai/OLMo-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allenai/OLMo-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="allenai/OLMo-7B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use allenai/OLMo-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "allenai/OLMo-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/OLMo-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/allenai/OLMo-7B
- SGLang
How to use allenai/OLMo-7B 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 "allenai/OLMo-7B" \ --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": "allenai/OLMo-7B", "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 "allenai/OLMo-7B" \ --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": "allenai/OLMo-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use allenai/OLMo-7B with Docker Model Runner:
docker model run hf.co/allenai/OLMo-7B
model annealed to lr 0
Browse files- config.json +1 -1
- pytorch_model.bin +1 -1
- special_tokens_map.json +1 -1
- tokenizer_config.json +1 -1
config.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
| 14 |
"d_model": 4096,
|
| 15 |
"embedding_dropout": 0.0,
|
| 16 |
"embedding_size": 50304,
|
| 17 |
-
"eos_token_id":
|
| 18 |
"flash_attention": true,
|
| 19 |
"include_bias": false,
|
| 20 |
"init_cutoff_factor": null,
|
|
|
|
| 14 |
"d_model": 4096,
|
| 15 |
"embedding_dropout": 0.0,
|
| 16 |
"embedding_size": 50304,
|
| 17 |
+
"eos_token_id": 50279,
|
| 18 |
"flash_attention": true,
|
| 19 |
"include_bias": false,
|
| 20 |
"init_cutoff_factor": null,
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 27552427238
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c691ecdf9ec32368e950af49421a699e321b6efad9d21387011c0ba9e985706f
|
| 3 |
size 27552427238
|
special_tokens_map.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"eos_token": "||
|
| 3 |
"pad_token": "<|padding|>"
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"eos_token": "<|endoftext|>",
|
| 3 |
"pad_token": "<|padding|>"
|
| 4 |
}
|
tokenizer_config.json
CHANGED
|
@@ -226,7 +226,7 @@
|
|
| 226 |
}
|
| 227 |
},
|
| 228 |
"clean_up_tokenization_spaces": true,
|
| 229 |
-
"eos_token": "||
|
| 230 |
"max_length": null,
|
| 231 |
"model_max_length": 1000000000000000019884624838656,
|
| 232 |
"pad_token": "<|padding|>",
|
|
|
|
| 226 |
}
|
| 227 |
},
|
| 228 |
"clean_up_tokenization_spaces": true,
|
| 229 |
+
"eos_token": "<|endoftext|>",
|
| 230 |
"max_length": null,
|
| 231 |
"model_max_length": 1000000000000000019884624838656,
|
| 232 |
"pad_token": "<|padding|>",
|