Instructions to use OrionZheng/openmoe-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OrionZheng/openmoe-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OrionZheng/openmoe-base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OrionZheng/openmoe-base", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("OrionZheng/openmoe-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OrionZheng/openmoe-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OrionZheng/openmoe-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OrionZheng/openmoe-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OrionZheng/openmoe-base
- SGLang
How to use OrionZheng/openmoe-base 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 "OrionZheng/openmoe-base" \ --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": "OrionZheng/openmoe-base", "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 "OrionZheng/openmoe-base" \ --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": "OrionZheng/openmoe-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OrionZheng/openmoe-base with Docker Model Runner:
docker model run hf.co/OrionZheng/openmoe-base
Commit ·
e00ffd4
1
Parent(s): 1f9518c
Update config.json
Browse files- config.json +5 -1
config.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
| 19 |
"hidden_size": 768,
|
| 20 |
"initializer_range": 0.02,
|
| 21 |
"intermediate_size": 2048,
|
|
|
|
| 22 |
"layer_norm_epsilon": 1e-06,
|
| 23 |
"load_balance_beam_width": 8,
|
| 24 |
"load_balance_group_swap_factor": 0.4,
|
|
@@ -36,15 +37,18 @@
|
|
| 36 |
"rms_norm_eps": 1e-06,
|
| 37 |
"rope_scaling": null,
|
| 38 |
"rope_theta": 10000.0,
|
|
|
|
| 39 |
"router_capacity_factor_eval": 2.0,
|
| 40 |
"router_capacity_factor_train": 1.25,
|
| 41 |
"router_drop_tks": true,
|
| 42 |
"router_min_capacity": 4,
|
| 43 |
"router_noisy_policy": null,
|
| 44 |
"router_topk": 2,
|
|
|
|
| 45 |
"tie_word_embeddings": false,
|
| 46 |
"torch_dtype": "float32",
|
| 47 |
"transformers_version": "4.34.0",
|
| 48 |
"use_cache": true,
|
| 49 |
-
"vocab_size": 256384
|
|
|
|
| 50 |
}
|
|
|
|
| 19 |
"hidden_size": 768,
|
| 20 |
"initializer_range": 0.02,
|
| 21 |
"intermediate_size": 2048,
|
| 22 |
+
"label_smoothing": 0.001,
|
| 23 |
"layer_norm_epsilon": 1e-06,
|
| 24 |
"load_balance_beam_width": 8,
|
| 25 |
"load_balance_group_swap_factor": 0.4,
|
|
|
|
| 37 |
"rms_norm_eps": 1e-06,
|
| 38 |
"rope_scaling": null,
|
| 39 |
"rope_theta": 10000.0,
|
| 40 |
+
"router_aux_loss_factor": 0.01,
|
| 41 |
"router_capacity_factor_eval": 2.0,
|
| 42 |
"router_capacity_factor_train": 1.25,
|
| 43 |
"router_drop_tks": true,
|
| 44 |
"router_min_capacity": 4,
|
| 45 |
"router_noisy_policy": null,
|
| 46 |
"router_topk": 2,
|
| 47 |
+
"router_z_loss_factor": 0.0001,
|
| 48 |
"tie_word_embeddings": false,
|
| 49 |
"torch_dtype": "float32",
|
| 50 |
"transformers_version": "4.34.0",
|
| 51 |
"use_cache": true,
|
| 52 |
+
"vocab_size": 256384,
|
| 53 |
+
"z_loss_factor": 0.01
|
| 54 |
}
|