Instructions to use TIGER-Lab/MAmmoTH-Coder-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TIGER-Lab/MAmmoTH-Coder-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TIGER-Lab/MAmmoTH-Coder-7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TIGER-Lab/MAmmoTH-Coder-7B") model = AutoModelForCausalLM.from_pretrained("TIGER-Lab/MAmmoTH-Coder-7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TIGER-Lab/MAmmoTH-Coder-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TIGER-Lab/MAmmoTH-Coder-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TIGER-Lab/MAmmoTH-Coder-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TIGER-Lab/MAmmoTH-Coder-7B
- SGLang
How to use TIGER-Lab/MAmmoTH-Coder-7B 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 "TIGER-Lab/MAmmoTH-Coder-7B" \ --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": "TIGER-Lab/MAmmoTH-Coder-7B", "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 "TIGER-Lab/MAmmoTH-Coder-7B" \ --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": "TIGER-Lab/MAmmoTH-Coder-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TIGER-Lab/MAmmoTH-Coder-7B with Docker Model Runner:
docker model run hf.co/TIGER-Lab/MAmmoTH-Coder-7B
Update README.md
Browse files
README.md
CHANGED
|
@@ -48,11 +48,31 @@ The models are evaluated using open-ended and multiple-choice math problems from
|
|
| 48 |
| MAmmoTH | 70B | Llama-2 | 76.7 | 44.2 | 61.4 | 64.3 | 61.7 | 81.7 | 55.3 | 45.3 | 58.6 | 52.3 | 58.6 |
|
| 49 |
|
| 50 |
|
| 51 |
-
|
| 52 |
## Usage
|
| 53 |
You can use the models through Huggingface's Transformers library. Use the pipeline function to create a text-generation pipeline with the model of your choice, then feed in a math problem to get the solution.
|
| 54 |
Check our Github repo for more advanced use: [https://github.com/TIGER-AI-Lab/MAmmoTH](https://github.com/TIGER-AI-Lab/MAmmoTH)
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
## Intended Uses
|
| 57 |
These models are trained for research purposes. They are designed to solve general math problems. They can be used in educational software, tutoring systems, or any application where a solution to a math problem is needed. The models can generate both a chain of thought (CoT) rationale and a program of thought (PoT) rationale, providing a comprehensive solution to a given math problem.
|
| 58 |
|
|
|
|
| 48 |
| MAmmoTH | 70B | Llama-2 | 76.7 | 44.2 | 61.4 | 64.3 | 61.7 | 81.7 | 55.3 | 45.3 | 58.6 | 52.3 | 58.6 |
|
| 49 |
|
| 50 |
|
|
|
|
| 51 |
## Usage
|
| 52 |
You can use the models through Huggingface's Transformers library. Use the pipeline function to create a text-generation pipeline with the model of your choice, then feed in a math problem to get the solution.
|
| 53 |
Check our Github repo for more advanced use: [https://github.com/TIGER-AI-Lab/MAmmoTH](https://github.com/TIGER-AI-Lab/MAmmoTH)
|
| 54 |
|
| 55 |
+
## Prompt Format
|
| 56 |
+
If you want to do CoT:
|
| 57 |
+
```
|
| 58 |
+
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
| 59 |
+
|
| 60 |
+
### Instruction:
|
| 61 |
+
{instruction}
|
| 62 |
+
|
| 63 |
+
### Response:
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
If you want to do PoT:
|
| 67 |
+
```
|
| 68 |
+
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
| 69 |
+
|
| 70 |
+
### Instruction:
|
| 71 |
+
{instruction} Let's write a program.
|
| 72 |
+
|
| 73 |
+
### Response:
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
## Intended Uses
|
| 77 |
These models are trained for research purposes. They are designed to solve general math problems. They can be used in educational software, tutoring systems, or any application where a solution to a math problem is needed. The models can generate both a chain of thought (CoT) rationale and a program of thought (PoT) rationale, providing a comprehensive solution to a given math problem.
|
| 78 |
|