Text Generation
Transformers
Safetensors
PyTorch
English
mobilemoe
facebook
meta
mixture-of-experts
MoE
on-device
quantization
int4
conversational
custom_code
8-bit precision
Instructions to use ml-resources/MobileMoE-M-QAT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ml-resources/MobileMoE-M-QAT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ml-resources/MobileMoE-M-QAT", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ml-resources/MobileMoE-M-QAT", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ml-resources/MobileMoE-M-QAT 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-QAT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ml-resources/MobileMoE-M-QAT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ml-resources/MobileMoE-M-QAT
- SGLang
How to use ml-resources/MobileMoE-M-QAT 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-QAT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ml-resources/MobileMoE-M-QAT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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-QAT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ml-resources/MobileMoE-M-QAT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ml-resources/MobileMoE-M-QAT with Docker Model Runner:
docker model run hf.co/ml-resources/MobileMoE-M-QAT
Download tokenizer_config.json from ml-resources/MobileMoE-M-QAT: direct link, hf CLI and curl.
- Browser
- Download file 886 Bytes
-
https://huggingface.co/ml-resources/MobileMoE-M-QAT/resolve/main/tokenizer_config.json
- Command line
-
hf download hf://ml-resources/MobileMoE-M-QAT/tokenizer_config.json
-
curl -L -o tokenizer_config.json https://huggingface.co/ml-resources/MobileMoE-M-QAT/resolve/main/tokenizer_config.json
886 Bytes
| { | |
| "add_bos_token": true, | |
| "add_eos_token": false, | |
| "bos_token": "<|begin_of_text|>", | |
| "eos_token": "<|eot|>", | |
| "pad_token": "<|end_of_text|>", | |
| "model_max_length": 8192, | |
| "tokenizer_class": "PreTrainedTokenizerFast", | |
| "clean_up_tokenization_spaces": true, | |
| "chat_template": "{{ bos_token }}{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|header_start|>' + message['role'] + '<|header_end|>\n\n' %}{% if message['content'] is string %}{% set content = content + message['content'] %}{% else %}{% for item in message['content'] %}{% if item['type'] == 'text' %}{% set content = content + item['text'] %}{% endif %}{% endfor %}{% endif %}{{ content + '<|eot|>' }}{% endfor %}{% if add_generation_prompt %}{{ '<|header_start|>assistant<|header_end|>\n\n' }}{% endif %}", | |
| "model_input_names": [ | |
| "input_ids", | |
| "attention_mask" | |
| ] | |
| } | |