Text Generation
Transformers
Safetensors
English
slm
arithmetic
math
causal-lm
custom_code
Eval Results (legacy)
Instructions to use WhirlwindAI/Arithmetic-SLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WhirlwindAI/Arithmetic-SLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="WhirlwindAI/Arithmetic-SLM", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("WhirlwindAI/Arithmetic-SLM", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use WhirlwindAI/Arithmetic-SLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WhirlwindAI/Arithmetic-SLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WhirlwindAI/Arithmetic-SLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/WhirlwindAI/Arithmetic-SLM
- SGLang
How to use WhirlwindAI/Arithmetic-SLM 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 "WhirlwindAI/Arithmetic-SLM" \ --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": "WhirlwindAI/Arithmetic-SLM", "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 "WhirlwindAI/Arithmetic-SLM" \ --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": "WhirlwindAI/Arithmetic-SLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use WhirlwindAI/Arithmetic-SLM with Docker Model Runner:
docker model run hf.co/WhirlwindAI/Arithmetic-SLM
Update README.md
Browse files
README.md
CHANGED
|
@@ -65,7 +65,7 @@ The goal is not to make a general chatbot. The goal is to train a compact model
|
|
| 65 |
<td align="center"><strong>82.08%</strong></td>
|
| 66 |
</tr>
|
| 67 |
<tr>
|
| 68 |
-
<td align="center"><code>
|
| 69 |
<td align="center">31.70M</td>
|
| 70 |
<td align="center"><strong>78.60%</strong></td>
|
| 71 |
</tr>
|
|
@@ -165,7 +165,7 @@ The goal is not to make a general chatbot. The goal is to train a compact model
|
|
| 165 |
|
| 166 |
```bash
|
| 167 |
python3 inference.py \
|
| 168 |
-
--model
|
| 169 |
--prompt "59 + 45 =" \
|
| 170 |
--max-new-tokens 32 \
|
| 171 |
--temperature 0.6 \
|
|
@@ -184,7 +184,7 @@ Expected style:
|
|
| 184 |
|
| 185 |
```bash
|
| 186 |
python3 inference.py \
|
| 187 |
-
--model
|
| 188 |
--prompt "0.5 * 0.5 =" \
|
| 189 |
--no-think \
|
| 190 |
--max-new-tokens 48 \
|
|
@@ -213,7 +213,7 @@ Example output:
|
|
| 213 |
|
| 214 |
```bash
|
| 215 |
python3 inference.py \
|
| 216 |
-
--model
|
| 217 |
--prompt "8 * 5 + 4 / 4 =" \
|
| 218 |
--no-think \
|
| 219 |
--max-new-tokens 48 \
|
|
@@ -233,7 +233,7 @@ Expected style:
|
|
| 233 |
|
| 234 |
```bash
|
| 235 |
python3 inference.py \
|
| 236 |
-
--model
|
| 237 |
--prompt "(85 - 45) + 56 =" \
|
| 238 |
--no-think \
|
| 239 |
--max-new-tokens 48 \
|
|
@@ -253,7 +253,7 @@ Expected style:
|
|
| 253 |
|
| 254 |
```bash
|
| 255 |
python3 inference.py \
|
| 256 |
-
--model
|
| 257 |
--prompt "3 * 9 + 12 / 1 =" \
|
| 258 |
--no-think \
|
| 259 |
--max-new-tokens 48 \
|
|
@@ -269,26 +269,6 @@ Expected style:
|
|
| 269 |
3 * 9 + 12 / 1 = 39
|
| 270 |
```
|
| 271 |
|
| 272 |
-
### Example 6 — BOS/EOS base mode for base models
|
| 273 |
-
|
| 274 |
-
Use this mode for base models that were not trained with the Qwen-style `[IM_START]user ... /no think[IM_END]` format.
|
| 275 |
-
|
| 276 |
-
```bash
|
| 277 |
-
python3 inference.py \
|
| 278 |
-
--model Supra-50M-Base-local \
|
| 279 |
-
--prompt "8 * 5 + 4 / 4 =" \
|
| 280 |
-
--no-qwen-format \
|
| 281 |
-
--max-new-tokens 32 \
|
| 282 |
-
--temperature 0.6 \
|
| 283 |
-
--top-k 50 \
|
| 284 |
-
--top-p 0.97 \
|
| 285 |
-
--repetition-penalty 1 \
|
| 286 |
-
--frequency-penalty 0.0 \
|
| 287 |
-
--no-repeat-ngram-size 0 \
|
| 288 |
-
--seed -1 \
|
| 289 |
-
--print-full
|
| 290 |
-
```
|
| 291 |
-
|
| 292 |
## Next Research Directions
|
| 293 |
|
| 294 |
We will continue improving our dataset engineering, but more importantly, we want to teach the model what most models are never explicitly taught:
|
|
|
|
| 65 |
<td align="center"><strong>82.08%</strong></td>
|
| 66 |
</tr>
|
| 67 |
<tr>
|
| 68 |
+
<td align="center"><code>WhirlwindAI/Arithmetic-SLM</code></td>
|
| 69 |
<td align="center">31.70M</td>
|
| 70 |
<td align="center"><strong>78.60%</strong></td>
|
| 71 |
</tr>
|
|
|
|
| 165 |
|
| 166 |
```bash
|
| 167 |
python3 inference.py \
|
| 168 |
+
--model WhirlwindAI/Arithmetic-SLM \
|
| 169 |
--prompt "59 + 45 =" \
|
| 170 |
--max-new-tokens 32 \
|
| 171 |
--temperature 0.6 \
|
|
|
|
| 184 |
|
| 185 |
```bash
|
| 186 |
python3 inference.py \
|
| 187 |
+
--model WhirlwindAI/Arithmetic-SLM \
|
| 188 |
--prompt "0.5 * 0.5 =" \
|
| 189 |
--no-think \
|
| 190 |
--max-new-tokens 48 \
|
|
|
|
| 213 |
|
| 214 |
```bash
|
| 215 |
python3 inference.py \
|
| 216 |
+
--model WhirlwindAI/Arithmetic-SLM \
|
| 217 |
--prompt "8 * 5 + 4 / 4 =" \
|
| 218 |
--no-think \
|
| 219 |
--max-new-tokens 48 \
|
|
|
|
| 233 |
|
| 234 |
```bash
|
| 235 |
python3 inference.py \
|
| 236 |
+
--model WhirlwindAI/Arithmetic-SLM \
|
| 237 |
--prompt "(85 - 45) + 56 =" \
|
| 238 |
--no-think \
|
| 239 |
--max-new-tokens 48 \
|
|
|
|
| 253 |
|
| 254 |
```bash
|
| 255 |
python3 inference.py \
|
| 256 |
+
--model WhirlwindAI/Arithmetic-SLM \
|
| 257 |
--prompt "3 * 9 + 12 / 1 =" \
|
| 258 |
--no-think \
|
| 259 |
--max-new-tokens 48 \
|
|
|
|
| 269 |
3 * 9 + 12 / 1 = 39
|
| 270 |
```
|
| 271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
## Next Research Directions
|
| 273 |
|
| 274 |
We will continue improving our dataset engineering, but more importantly, we want to teach the model what most models are never explicitly taught:
|