Text Generation
Transformers
Safetensors
English
emo
Mixture of Experts
mixture-of-experts
baseline
conversational
custom_code
Instructions to use allenai/StdMoE_1b14b_1T with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allenai/StdMoE_1b14b_1T with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="allenai/StdMoE_1b14b_1T", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("allenai/StdMoE_1b14b_1T", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use allenai/StdMoE_1b14b_1T with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "allenai/StdMoE_1b14b_1T" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/StdMoE_1b14b_1T", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/allenai/StdMoE_1b14b_1T
- SGLang
How to use allenai/StdMoE_1b14b_1T 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/StdMoE_1b14b_1T" \ --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": "allenai/StdMoE_1b14b_1T", "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 "allenai/StdMoE_1b14b_1T" \ --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": "allenai/StdMoE_1b14b_1T", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use allenai/StdMoE_1b14b_1T with Docker Model Runner:
docker model run hf.co/allenai/StdMoE_1b14b_1T
Emo rename: patch config.json
Browse files- config.json +4 -4
config.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
"always_active_experts": null,
|
| 3 |
"always_active_experts_per_layer": null,
|
| 4 |
"architectures": [
|
| 5 |
-
"
|
| 6 |
],
|
| 7 |
"attention_bias": false,
|
| 8 |
"attention_dropout": 0.0,
|
|
@@ -15,7 +15,7 @@
|
|
| 15 |
"initializer_range": 0.02,
|
| 16 |
"intermediate_size": 1024,
|
| 17 |
"max_position_embeddings": 4096,
|
| 18 |
-
"model_type": "
|
| 19 |
"norm_topk_prob": false,
|
| 20 |
"num_attention_heads": 16,
|
| 21 |
"num_experts": 128,
|
|
@@ -36,7 +36,7 @@
|
|
| 36 |
"use_cache": true,
|
| 37 |
"vocab_size": 100352,
|
| 38 |
"auto_map": {
|
| 39 |
-
"AutoConfig": "
|
| 40 |
-
"AutoModelForCausalLM": "
|
| 41 |
}
|
| 42 |
}
|
|
|
|
| 2 |
"always_active_experts": null,
|
| 3 |
"always_active_experts_per_layer": null,
|
| 4 |
"architectures": [
|
| 5 |
+
"EmoForCausalLM"
|
| 6 |
],
|
| 7 |
"attention_bias": false,
|
| 8 |
"attention_dropout": 0.0,
|
|
|
|
| 15 |
"initializer_range": 0.02,
|
| 16 |
"intermediate_size": 1024,
|
| 17 |
"max_position_embeddings": 4096,
|
| 18 |
+
"model_type": "emo",
|
| 19 |
"norm_topk_prob": false,
|
| 20 |
"num_attention_heads": 16,
|
| 21 |
"num_experts": 128,
|
|
|
|
| 36 |
"use_cache": true,
|
| 37 |
"vocab_size": 100352,
|
| 38 |
"auto_map": {
|
| 39 |
+
"AutoConfig": "configuration_emo.EmoConfig",
|
| 40 |
+
"AutoModelForCausalLM": "modeling_emo.EmoForCausalLM"
|
| 41 |
}
|
| 42 |
}
|