Text Generation
Transformers
Safetensors
PyTorch
English
mobilemoe
facebook
meta
mixture-of-experts
MoE
on-device
custom_code
Run this model with HF Jobs
Run ml-resources/MobileMoE-M-Base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/ml-resources/MobileMoE-M-Base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ml-resources/MobileMoE-M-Base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/ml-resources/MobileMoE-M-Base. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/ml-resources/MobileMoE-M-Base. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use ml-resources/MobileMoE-M-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ml-resources/MobileMoE-M-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ml-resources/MobileMoE-M-Base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ml-resources/MobileMoE-M-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ml-resources/MobileMoE-M-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-M-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-M-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ml-resources/MobileMoE-M-Base
- SGLang
How to use ml-resources/MobileMoE-M-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-M-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-M-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-M-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-M-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ml-resources/MobileMoE-M-Base with Docker Model Runner:
docker model run hf.co/ml-resources/MobileMoE-M-Base
File size: 1,963 Bytes
de35c17 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | {
"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": 1024,
"intermediate_size": 512,
"intermediate_size_mlp": 2048,
"num_hidden_layers": 26,
"num_attention_heads": 16,
"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
],
"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"
],
"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
}
|