Instructions to use HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath") model = AutoModelForCausalLM.from_pretrained("HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath
- SGLang
How to use HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath 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 "HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath" \ --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": "HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath", "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 "HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath" \ --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": "HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath with Docker Model Runner:
docker model run hf.co/HachiML/Swallow-MS-7b-v0.1-MathSkill-OpenMath
Update README.md
Browse files
README.md
CHANGED
|
@@ -78,7 +78,8 @@ Below are examples of responses from the model, demonstrating how the SkillTree
|
|
| 78 |
### Example 1:
|
| 79 |
|
| 80 |
- **Input:** Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?\n
|
| 81 |
-
- **Output:**
|
|
|
|
| 82 |
Let's solve this problem using Python code.
|
| 83 |
<llm-code>
|
| 84 |
friends_sold_in_April = 48
|
|
@@ -95,7 +96,8 @@ Thus, in April and May, Natalia sold \boxed{72} clips in total.
|
|
| 95 |
### Example 2:
|
| 96 |
|
| 97 |
- **Input:** ナタリアは4月に48人の友人にクリップを売り、5月にはその半分の数のクリップを売った。ナタリアが4月と5月に売ったクリップの数は?:\n
|
| 98 |
-
- **Output:**
|
|
|
|
| 99 |
Let's solve this problem using Python code.
|
| 100 |
<llm-code>
|
| 101 |
clip_count = 48
|
|
|
|
| 78 |
### Example 1:
|
| 79 |
|
| 80 |
- **Input:** Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?\n
|
| 81 |
+
- **Output:**
|
| 82 |
+
```
|
| 83 |
Let's solve this problem using Python code.
|
| 84 |
<llm-code>
|
| 85 |
friends_sold_in_April = 48
|
|
|
|
| 96 |
### Example 2:
|
| 97 |
|
| 98 |
- **Input:** ナタリアは4月に48人の友人にクリップを売り、5月にはその半分の数のクリップを売った。ナタリアが4月と5月に売ったクリップの数は?:\n
|
| 99 |
+
- **Output:**
|
| 100 |
+
```
|
| 101 |
Let's solve this problem using Python code.
|
| 102 |
<llm-code>
|
| 103 |
clip_count = 48
|