Text Generation
Transformers
Safetensors
English
mixture-of-experts
gpt2
research
expert-specialization
Instructions to use sumitdotml/moe-emergence with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sumitdotml/moe-emergence with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sumitdotml/moe-emergence")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sumitdotml/moe-emergence", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use sumitdotml/moe-emergence with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sumitdotml/moe-emergence" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sumitdotml/moe-emergence", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sumitdotml/moe-emergence
- SGLang
How to use sumitdotml/moe-emergence 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 "sumitdotml/moe-emergence" \ --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": "sumitdotml/moe-emergence", "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 "sumitdotml/moe-emergence" \ --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": "sumitdotml/moe-emergence", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sumitdotml/moe-emergence with Docker Model Runner:
docker model run hf.co/sumitdotml/moe-emergence
Upload no-lb-ablation/final-model.json with huggingface_hub
Browse files
no-lb-ablation/final-model.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"format_version": 1,
|
| 3 |
+
"step": 500,
|
| 4 |
+
"preset": "no-lb",
|
| 5 |
+
"mode": "moe",
|
| 6 |
+
"config": {
|
| 7 |
+
"preset": "no-lb",
|
| 8 |
+
"mode": "moe",
|
| 9 |
+
"run_name": "no-lb-ablation",
|
| 10 |
+
"seed": 42,
|
| 11 |
+
"max_steps": 2000,
|
| 12 |
+
"batch_size": 2,
|
| 13 |
+
"grad_accum_steps": 4,
|
| 14 |
+
"effective_batch_size": 8,
|
| 15 |
+
"block_size": 512,
|
| 16 |
+
"learning_rate": 5e-05,
|
| 17 |
+
"weight_decay": 0.01,
|
| 18 |
+
"warmup_fraction": 0.1,
|
| 19 |
+
"max_grad_norm": 1.0,
|
| 20 |
+
"lb_coef": 0.0,
|
| 21 |
+
"z_coef": 0.001,
|
| 22 |
+
"n_experts": 8,
|
| 23 |
+
"topk": 1,
|
| 24 |
+
"noise_std": 0.0,
|
| 25 |
+
"moe_layers": [
|
| 26 |
+
8,
|
| 27 |
+
9,
|
| 28 |
+
10,
|
| 29 |
+
11
|
| 30 |
+
],
|
| 31 |
+
"size_mb": 10.0,
|
| 32 |
+
"balance_tokens": true,
|
| 33 |
+
"eval_every": 100,
|
| 34 |
+
"save_every": 100,
|
| 35 |
+
"collapse_early_stop": true
|
| 36 |
+
},
|
| 37 |
+
"metrics_summary": {
|
| 38 |
+
"train_loss": 2.845479725241661,
|
| 39 |
+
"lm_loss": 2.84168404340744
|
| 40 |
+
}
|
| 41 |
+
}
|