Instructions to use peiyi9979/math-shepherd-mistral-7b-rl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use peiyi9979/math-shepherd-mistral-7b-rl with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="peiyi9979/math-shepherd-mistral-7b-rl")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("peiyi9979/math-shepherd-mistral-7b-rl") model = AutoModelForCausalLM.from_pretrained("peiyi9979/math-shepherd-mistral-7b-rl") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use peiyi9979/math-shepherd-mistral-7b-rl with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "peiyi9979/math-shepherd-mistral-7b-rl" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "peiyi9979/math-shepherd-mistral-7b-rl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/peiyi9979/math-shepherd-mistral-7b-rl
- SGLang
How to use peiyi9979/math-shepherd-mistral-7b-rl 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 "peiyi9979/math-shepherd-mistral-7b-rl" \ --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": "peiyi9979/math-shepherd-mistral-7b-rl", "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 "peiyi9979/math-shepherd-mistral-7b-rl" \ --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": "peiyi9979/math-shepherd-mistral-7b-rl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use peiyi9979/math-shepherd-mistral-7b-rl with Docker Model Runner:
docker model run hf.co/peiyi9979/math-shepherd-mistral-7b-rl
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Mistral-7b-MetaMATH with step-by-step PPO in Math-Shepherd.
Base model: mistral-7b-sft.
PRM: math-shepherd-mistral-7b-prm.
PPO training set: questions in MetaMATH [1].
Pass@1:
- GSM8K: 84.1
- MATH: 33.0
Input: only the math problem, without any system prompt, e.g.,
Janet\u2019s ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?
Output: Step-by-step solutions with a special step tag ки, e.g.,
Step 1: Janet's ducks lay 16 eggs per day. ки\nStep 2: She eats three for breakfast every morning, so she has 16 - 3 = 13 eggs left. ки\nStep 3: She bakes muffins for her friends every day with four eggs, so she has 13 - 4 = 9 eggs left. ки\nStep 4: She sells the remainder at the farmers' market daily for $2 per fresh duck egg, so she makes 9 * $2 = $18 every day at the farmers' market. The answer is: 18 ки
[1] MetaMath: Bootstrap Your Own Mathematical Questions for Large Language Models.
- Downloads last month
- 692