meta-math/MetaMathQA
Viewer • Updated • 395k • 59.6k • 457
How to use Wanfq/metamath-llemma-34b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Wanfq/metamath-llemma-34b") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Wanfq/metamath-llemma-34b")
model = AutoModelForCausalLM.from_pretrained("Wanfq/metamath-llemma-34b")How to use Wanfq/metamath-llemma-34b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Wanfq/metamath-llemma-34b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Wanfq/metamath-llemma-34b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Wanfq/metamath-llemma-34b
How to use Wanfq/metamath-llemma-34b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Wanfq/metamath-llemma-34b" \
--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": "Wanfq/metamath-llemma-34b",
"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 "Wanfq/metamath-llemma-34b" \
--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": "Wanfq/metamath-llemma-34b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Wanfq/metamath-llemma-34b with Docker Model Runner:
docker model run hf.co/Wanfq/metamath-llemma-34b
metamath-llemma-34b is Q-Lora fine-tuned on the MetaMathQA datasets and based on the powerful llemma-34b model.
pip install transformers==4.35.0
pip install torch==2.0.1
pip install sentencepiece==0.1.99
pip install tokenizers==0.13.3
pip install accelerate==0.21.0
pip install bitsandbytes==0.40.0
pip install vllm
pip install fraction
pip install protobuf
prompting template:
'''
"Below is an instruction that describes a task. " "Write a response that appropriately completes the request.\n\n" "### Instruction:\n{instruction}\n\n### Response: Let's think step by step."
'''
where you need to use your query question to replace the {instruction}
| Model | GSM8k Pass@1 | MATH Pass@1 |
|---|---|---|
| MetaMath-7B | 66.5 | 19.8 |
| MetaMath-13B | 72.3 | 22.4 |
| MetaMath-70B | 82.3 | 26.6 |
| MetaMath-Llemma-7B | 69.2 | 30.0 |
| MetaMath-Mistral-7B | 77.7 | 28.2 |
| 🔥 metamath-llemma-34B | 76.1 | 31.4 |
Model card adapted from MetaMath-70B-V1.0