Instructions to use hf-internal-testing/MiniMax-M2-Small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/MiniMax-M2-Small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hf-internal-testing/MiniMax-M2-Small")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/MiniMax-M2-Small") model = AutoModelForCausalLM.from_pretrained("hf-internal-testing/MiniMax-M2-Small") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hf-internal-testing/MiniMax-M2-Small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hf-internal-testing/MiniMax-M2-Small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hf-internal-testing/MiniMax-M2-Small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hf-internal-testing/MiniMax-M2-Small
- SGLang
How to use hf-internal-testing/MiniMax-M2-Small 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 "hf-internal-testing/MiniMax-M2-Small" \ --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": "hf-internal-testing/MiniMax-M2-Small", "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 "hf-internal-testing/MiniMax-M2-Small" \ --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": "hf-internal-testing/MiniMax-M2-Small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hf-internal-testing/MiniMax-M2-Small with Docker Model Runner:
docker model run hf.co/hf-internal-testing/MiniMax-M2-Small
Upload MiniMaxM2ForCausalLM
Browse files- config.json +1 -1
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
| 15 |
"model_type": "minimax_m2",
|
| 16 |
"num_attention_heads": 2,
|
| 17 |
"num_experts_per_tok": 2,
|
| 18 |
-
"num_hidden_layers":
|
| 19 |
"num_key_value_heads": 1,
|
| 20 |
"num_local_experts": 8,
|
| 21 |
"output_router_logits": false,
|
|
|
|
| 15 |
"model_type": "minimax_m2",
|
| 16 |
"num_attention_heads": 2,
|
| 17 |
"num_experts_per_tok": 2,
|
| 18 |
+
"num_hidden_layers": 5,
|
| 19 |
"num_key_value_heads": 1,
|
| 20 |
"num_local_experts": 8,
|
| 21 |
"output_router_logits": false,
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5f10fce0fe3e5c7ee3626dd2f0270a5e0a540f59a70d2c6d6ed28a7f53cccf81
|
| 3 |
+
size 224607248
|