TIGER-Lab/MathInstruct
Viewer • Updated • 262k • 32.4k • 306
How to use adalaw/MAmmoTH-7B-Mistral-MFT with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="adalaw/MAmmoTH-7B-Mistral-MFT") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("adalaw/MAmmoTH-7B-Mistral-MFT")
model = AutoModelForCausalLM.from_pretrained("adalaw/MAmmoTH-7B-Mistral-MFT", device_map="auto")How to use adalaw/MAmmoTH-7B-Mistral-MFT with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "adalaw/MAmmoTH-7B-Mistral-MFT"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "adalaw/MAmmoTH-7B-Mistral-MFT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/adalaw/MAmmoTH-7B-Mistral-MFT
How to use adalaw/MAmmoTH-7B-Mistral-MFT with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "adalaw/MAmmoTH-7B-Mistral-MFT" \
--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": "adalaw/MAmmoTH-7B-Mistral-MFT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "adalaw/MAmmoTH-7B-Mistral-MFT" \
--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": "adalaw/MAmmoTH-7B-Mistral-MFT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use adalaw/MAmmoTH-7B-Mistral-MFT with Docker Model Runner:
docker model run hf.co/adalaw/MAmmoTH-7B-Mistral-MFT
The model is trained with Masked Thought Fine-Tuning (MFT), a simple variant of standard Supervised Fine-Tuning (SFT). You can refer to our code and paper below.
We test it with the Hybrid decoding scripts provided in MAmmoTH.
| Model | GSM8K | MATH |
|---|---|---|
| adalaw/MAmmoTH-7B-Mistral-MFT | 77.10 | 41.2 |
| TIGER-Lab/MAmmoTH-7B-Mistral-SFT | 75.00 | 40.0 |