Instructions to use simonycl/OLMoE-1B-7B-0125-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use simonycl/OLMoE-1B-7B-0125-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="simonycl/OLMoE-1B-7B-0125-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("simonycl/OLMoE-1B-7B-0125-Instruct") model = AutoModelForCausalLM.from_pretrained("simonycl/OLMoE-1B-7B-0125-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use simonycl/OLMoE-1B-7B-0125-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "simonycl/OLMoE-1B-7B-0125-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "simonycl/OLMoE-1B-7B-0125-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/simonycl/OLMoE-1B-7B-0125-Instruct
- SGLang
How to use simonycl/OLMoE-1B-7B-0125-Instruct 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 "simonycl/OLMoE-1B-7B-0125-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "simonycl/OLMoE-1B-7B-0125-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "simonycl/OLMoE-1B-7B-0125-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "simonycl/OLMoE-1B-7B-0125-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use simonycl/OLMoE-1B-7B-0125-Instruct with Docker Model Runner:
docker model run hf.co/simonycl/OLMoE-1B-7B-0125-Instruct
Upload OlmoeForCausalLM
Browse files- config.json +32 -0
- generation_config.json +6 -0
- model-00001-of-00006.safetensors +3 -0
- model-00002-of-00006.safetensors +3 -0
- model-00003-of-00006.safetensors +3 -0
- model-00004-of-00006.safetensors +3 -0
- model-00005-of-00006.safetensors +3 -0
- model-00006-of-00006.safetensors +3 -0
- model.safetensors.index.json +0 -0
config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"OlmoeForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"clip_qkv": null,
|
| 8 |
+
"dtype": "float32",
|
| 9 |
+
"eos_token_id": 50279,
|
| 10 |
+
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 2048,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 1024,
|
| 14 |
+
"max_position_embeddings": 4096,
|
| 15 |
+
"model_type": "olmoe",
|
| 16 |
+
"norm_topk_prob": false,
|
| 17 |
+
"num_attention_heads": 16,
|
| 18 |
+
"num_experts": 64,
|
| 19 |
+
"num_experts_per_tok": 8,
|
| 20 |
+
"num_hidden_layers": 16,
|
| 21 |
+
"num_key_value_heads": 16,
|
| 22 |
+
"output_router_logits": false,
|
| 23 |
+
"pad_token_id": 1,
|
| 24 |
+
"rms_norm_eps": 1e-05,
|
| 25 |
+
"rope_scaling": null,
|
| 26 |
+
"rope_theta": 10000.0,
|
| 27 |
+
"router_aux_loss_coef": 0.01,
|
| 28 |
+
"tie_word_embeddings": false,
|
| 29 |
+
"transformers_version": "4.57.0.dev0",
|
| 30 |
+
"use_cache": false,
|
| 31 |
+
"vocab_size": 50304
|
| 32 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"eos_token_id": 50279,
|
| 4 |
+
"pad_token_id": 1,
|
| 5 |
+
"transformers_version": "4.57.0.dev0"
|
| 6 |
+
}
|
model-00001-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6973b5e035b4291cc1232637fd9811c03bd05831d1381ebe98770d68aa51d349
|
| 3 |
+
size 4993992240
|
model-00002-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:10c1f31bbb7b4b52a14058caaf50c7d98dee223cd560a8dfc79da0742b08cc0d
|
| 3 |
+
size 4992966080
|
model-00003-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5bfffde140d7920232905fca636dbf001d5106927e33a4d06b53a61474b20f6a
|
| 3 |
+
size 4992966080
|
model-00004-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6a242ebfea63b100a9a30c2684ee0d76e2a22f61e4268c20b791e4dc3dec1700
|
| 3 |
+
size 4992966416
|
model-00005-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dc58a1ce2a164addc23d01d0aadb90bfdfa47303f4bfcf867c6f28ec226b8abb
|
| 3 |
+
size 4992966680
|
model-00006-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f5c33b4b7073d825c142358d38b99900e775327a10356829a965bb5b5b1f5f3a
|
| 3 |
+
size 2711184968
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|