meta-math/MetaMathQA
Viewer • Updated • 395k • 64.5k • 457
How to use adalaw/MetaMath-Mistral-7B-MFT with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="adalaw/MetaMath-Mistral-7B-MFT") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("adalaw/MetaMath-Mistral-7B-MFT")
model = AutoModelForCausalLM.from_pretrained("adalaw/MetaMath-Mistral-7B-MFT")How to use adalaw/MetaMath-Mistral-7B-MFT with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "adalaw/MetaMath-Mistral-7B-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/MetaMath-Mistral-7B-MFT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/adalaw/MetaMath-Mistral-7B-MFT
How to use adalaw/MetaMath-Mistral-7B-MFT with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "adalaw/MetaMath-Mistral-7B-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/MetaMath-Mistral-7B-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/MetaMath-Mistral-7B-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/MetaMath-Mistral-7B-MFT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use adalaw/MetaMath-Mistral-7B-MFT with Docker Model Runner:
docker model run hf.co/adalaw/MetaMath-Mistral-7B-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 scripts provided in MetaMath.
| Model | GSM8K | MATH |
|---|---|---|
| adalaw/MetaMath-Mistral-7B-MFT | 79.90 | 29.0 |
| meta-math/MetaMath-Mistral-7B-SFT | 77.70 | 28.2 |