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
| { | |
| "format_version": 1, | |
| "step": 9999, | |
| "preset": "moe-main", | |
| "mode": "moe", | |
| "config": { | |
| "preset": "moe-main", | |
| "mode": "moe", | |
| "run_name": "moe-main", | |
| "seed": 42, | |
| "max_steps": 10000, | |
| "batch_size": 2, | |
| "grad_accum_steps": 4, | |
| "effective_batch_size": 8, | |
| "block_size": 512, | |
| "learning_rate": 5e-05, | |
| "weight_decay": 0.01, | |
| "warmup_fraction": 0.1, | |
| "max_grad_norm": 1.0, | |
| "lb_coef": 0.01, | |
| "z_coef": 0.001, | |
| "n_experts": 8, | |
| "topk": 1, | |
| "noise_std": 0.1, | |
| "moe_layers": [ | |
| 8, | |
| 9, | |
| 10, | |
| 11 | |
| ], | |
| "size_mb": 10.0, | |
| "balance_tokens": true, | |
| "eval_every": 200, | |
| "save_every": 500, | |
| "collapse_early_stop": false | |
| }, | |
| "metrics_summary": { | |
| "eval_loss": 2.0798, | |
| "eval_perplexity": 7.9147 | |
| } | |
| } |