Instructions to use TIGER-Lab/MAmmoTH-Coder-34B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TIGER-Lab/MAmmoTH-Coder-34B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TIGER-Lab/MAmmoTH-Coder-34B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TIGER-Lab/MAmmoTH-Coder-34B") model = AutoModelForCausalLM.from_pretrained("TIGER-Lab/MAmmoTH-Coder-34B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TIGER-Lab/MAmmoTH-Coder-34B 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-34B" # 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-34B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TIGER-Lab/MAmmoTH-Coder-34B
- SGLang
How to use TIGER-Lab/MAmmoTH-Coder-34B 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-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": "TIGER-Lab/MAmmoTH-Coder-34B", "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-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": "TIGER-Lab/MAmmoTH-Coder-34B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TIGER-Lab/MAmmoTH-Coder-34B with Docker Model Runner:
docker model run hf.co/TIGER-Lab/MAmmoTH-Coder-34B
Update README.md
Browse files
README.md
CHANGED
|
@@ -53,6 +53,27 @@ The models are evaluated using open-ended and multiple-choice math problems from
|
|
| 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 |
|
|
|
|
| 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 |
+
## Prompt Format
|
| 57 |
+
If you want to do CoT:
|
| 58 |
+
```
|
| 59 |
+
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
| 60 |
+
|
| 61 |
+
### Instruction:
|
| 62 |
+
{instruction}
|
| 63 |
+
|
| 64 |
+
### Response:
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
If you want to do PoT:
|
| 68 |
+
```
|
| 69 |
+
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
| 70 |
+
|
| 71 |
+
### Instruction:
|
| 72 |
+
{instruction} Let's write a program.
|
| 73 |
+
|
| 74 |
+
### Response:
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
## Intended Uses
|
| 78 |
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.
|
| 79 |
|