Text Generation
Transformers
Safetensors
PyTorch
English
mobilemoe
facebook
meta
mixture-of-experts
MoE
on-device
custom_code
Instructions to use ml-resources/MobileMoE-L-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ml-resources/MobileMoE-L-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ml-resources/MobileMoE-L-Base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ml-resources/MobileMoE-L-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ml-resources/MobileMoE-L-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ml-resources/MobileMoE-L-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ml-resources/MobileMoE-L-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ml-resources/MobileMoE-L-Base
- SGLang
How to use ml-resources/MobileMoE-L-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 "ml-resources/MobileMoE-L-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": "ml-resources/MobileMoE-L-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 "ml-resources/MobileMoE-L-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": "ml-resources/MobileMoE-L-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ml-resources/MobileMoE-L-Base with Docker Model Runner:
docker model run hf.co/ml-resources/MobileMoE-L-Base
Download config.json from ml-resources/MobileMoE-L-Base: direct link, hf CLI and curl.
- Browser
- Download file 2.14 kB
-
https://huggingface.co/ml-resources/MobileMoE-L-Base/resolve/main/config.json
- Command line
-
hf download hf://ml-resources/MobileMoE-L-Base/config.json
-
curl -L -o config.json https://huggingface.co/ml-resources/MobileMoE-L-Base/resolve/main/config.json
2.14 kB
| { | |
| "model_type": "mobilemoe", | |
| "architectures": [ | |
| "MobileMoEForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_mobilemoe.MobileMoEConfig", | |
| "AutoModel": "modeling_mobilemoe.MobileMoETextModel", | |
| "AutoModelForCausalLM": "modeling_mobilemoe.MobileMoEForCausalLM" | |
| }, | |
| "vocab_size": 128256, | |
| "bos_token_id": 128000, | |
| "eos_token_id": 128001, | |
| "hidden_size": 1280, | |
| "intermediate_size": 640, | |
| "intermediate_size_mlp": 2560, | |
| "num_hidden_layers": 32, | |
| "num_attention_heads": 20, | |
| "num_key_value_heads": 4, | |
| "head_dim": 64, | |
| "hidden_act": "silu", | |
| "max_position_embeddings": 8192, | |
| "rms_norm_eps": 1e-05, | |
| "rope_theta": 500000.0, | |
| "rope_scaling": { | |
| "rope_type": "llama3", | |
| "factor": 16, | |
| "original_max_position_embeddings": 8192, | |
| "low_freq_factor": 1.0, | |
| "high_freq_factor": 1.0 | |
| }, | |
| "num_local_experts": 60, | |
| "num_experts_per_tok": 4, | |
| "interleave_moe_layer_step": 1, | |
| "no_rope_layers": [ | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1 | |
| ], | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "use_qk_norm": true, | |
| "attn_temperature_tuning": false, | |
| "tie_word_embeddings": true, | |
| "torch_dtype": "bfloat16", | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "routed_scaling_factor": 2.5, | |
| "norm_topk_prob": true | |
| } | |