Text Generation
Transformers
Safetensors
English
mixtral
mathematics
reasoning
algebra
arithmetic
geometry
calculus
statistics
number-theory
ai
adaption-labs
autoscientist
lora
education
stem
conversational
text-generation-inference
Instructions to use Charley890/AdaptiveMath with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Charley890/AdaptiveMath with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Charley890/AdaptiveMath") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Charley890/AdaptiveMath") model = AutoModelForCausalLM.from_pretrained("Charley890/AdaptiveMath", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Charley890/AdaptiveMath with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Charley890/AdaptiveMath" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Charley890/AdaptiveMath", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Charley890/AdaptiveMath
- SGLang
How to use Charley890/AdaptiveMath 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 "Charley890/AdaptiveMath" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Charley890/AdaptiveMath", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Charley890/AdaptiveMath" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Charley890/AdaptiveMath", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Charley890/AdaptiveMath with Docker Model Runner:
docker model run hf.co/Charley890/AdaptiveMath
Update README.md
Browse files
README.md
CHANGED
|
@@ -161,11 +161,7 @@ It performs best when explaining every intermediate step before arriving at the
|
|
| 161 |
| Algebra | Linear Equations, Quadratic Equations, Polynomial Factorization |
|
| 162 |
| Geometry | Angles, Triangles, Circles, Coordinate Geometry |
|
| 163 |
| Calculus | Differentiation, Integration, Limits |
|
| 164 |
-
| Statistics | Mean, Median, Mode, Variance, Standard Deviation
|
| 165 |
-
| Probability | Conditional Probability, Bayes' Theorem |
|
| 166 |
-
| Number Theory | Prime Numbers, Divisibility, Modular Arithmetic |
|
| 167 |
-
| Trigonometry | Sine, Cosine, Tangent, Identities |
|
| 168 |
-
| Linear Algebra | Matrices, Determinants, Eigenvalues |
|
| 169 |
|
| 170 |
## Fundamental Mathematical Formulae
|
| 171 |
|
|
@@ -175,79 +171,50 @@ It performs best when explaining every intermediate step before arriving at the
|
|
| 175 |
| Pythagorean Theorem | $a^2+b^2=c^2$ |
|
| 176 |
| Distance Formula | $d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}$ |
|
| 177 |
| Midpoint Formula | $M=\left(\frac{x_1+x_2}{2},\frac{y_1+y_2}{2}\right)$ |
|
| 178 |
-
| Slope Formula | $m=\frac{y_2-y_1}{x_2-x_1}$ |
|
| 179 |
-
| Point-Slope Form | $y-y_1=m(x-x_1)$ |
|
| 180 |
-
| Equation of a Line | $y=mx+b$ |
|
| 181 |
-
| Area of Circle | $A=\pi r^2$ |
|
| 182 |
-
| Circumference | $C=2\pi r$ |
|
| 183 |
-
| Volume of Sphere | $V=\frac43\pi r^3$ |
|
| 184 |
-
| Surface Area of Sphere | $A=4\pi r^2$ |
|
| 185 |
-
| Volume of Cylinder | $V=\pi r^2h$ |
|
| 186 |
-
|
| 187 |
|
| 188 |
---
|
| 189 |
-
|
| 190 |
-
# 💻 Example Usage
|
| 191 |
|
| 192 |
## Example 1
|
| 193 |
|
| 194 |
**Input**
|
| 195 |
-
|
| 196 |
```text
|
| 197 |
Solve:
|
| 198 |
-
|
| 199 |
2x+7=19
|
| 200 |
```
|
| 201 |
-
|
| 202 |
**Output**
|
| 203 |
-
|
| 204 |
```text
|
| 205 |
Subtract 7 from both sides.
|
| 206 |
-
|
| 207 |
2x=12
|
| 208 |
-
|
| 209 |
Divide both sides by 2.
|
| 210 |
-
|
| 211 |
x=6
|
| 212 |
```
|
| 213 |
-
|
| 214 |
---
|
| 215 |
|
| 216 |
## Example 2
|
| 217 |
|
| 218 |
**Input**
|
| 219 |
-
|
| 220 |
```text
|
| 221 |
Find the derivative of
|
| 222 |
-
|
| 223 |
f(x)=x²+5x+2
|
| 224 |
```
|
| 225 |
-
|
| 226 |
**Output**
|
| 227 |
-
|
| 228 |
```text
|
| 229 |
Using the power rule,
|
| 230 |
-
|
| 231 |
f'(x)=2x+5
|
| 232 |
```
|
| 233 |
-
|
| 234 |
---
|
| 235 |
-
|
| 236 |
## Example 3
|
| 237 |
|
| 238 |
**Input**
|
| 239 |
-
|
| 240 |
```text
|
| 241 |
Find the area of a circle with radius 7.
|
| 242 |
```
|
| 243 |
-
|
| 244 |
**Output**
|
| 245 |
-
|
| 246 |
```text
|
| 247 |
A=\pi r^2
|
| 248 |
-
|
| 249 |
A=49\pi
|
| 250 |
-
|
| 251 |
≈153.94
|
| 252 |
```
|
| 253 |
```text
|
|
@@ -259,7 +226,6 @@ A=49\pi
|
|
| 259 |
/_____|
|
| 260 |
a
|
| 261 |
```
|
| 262 |
-
|
| 263 |
---
|
| 264 |
```text
|
| 265 |
y
|
|
@@ -272,8 +238,6 @@ A=49\pi
|
|
| 272 |
-1 │
|
| 273 |
-2 │
|
| 274 |
```
|
| 275 |
-
|
| 276 |
-
|
| 277 |
---
|
| 278 |
|
| 279 |
# Inference with Transformers
|
|
@@ -281,22 +245,15 @@ A=49\pi
|
|
| 281 |
```python
|
| 282 |
from transformers import AutoTokenizer
|
| 283 |
from transformers import AutoModelForCausalLM
|
| 284 |
-
|
| 285 |
model_name = "Charlie890/Adaptive-Math-Reasoner-Mixtral-8x7B"
|
| 286 |
-
|
| 287 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 288 |
-
|
| 289 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 290 |
-
|
| 291 |
prompt = "Solve: 3x + 5 = 20"
|
| 292 |
-
|
| 293 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 294 |
-
|
| 295 |
outputs = model.generate(
|
| 296 |
**inputs,
|
| 297 |
max_new_tokens=256
|
| 298 |
)
|
| 299 |
-
|
| 300 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 301 |
```
|
| 302 |
|
|
|
|
| 161 |
| Algebra | Linear Equations, Quadratic Equations, Polynomial Factorization |
|
| 162 |
| Geometry | Angles, Triangles, Circles, Coordinate Geometry |
|
| 163 |
| Calculus | Differentiation, Integration, Limits |
|
| 164 |
+
| Statistics | Mean, Median, Mode, Variance, Standard Deviation,etc.|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
## Fundamental Mathematical Formulae
|
| 167 |
|
|
|
|
| 171 |
| Pythagorean Theorem | $a^2+b^2=c^2$ |
|
| 172 |
| Distance Formula | $d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}$ |
|
| 173 |
| Midpoint Formula | $M=\left(\frac{x_1+x_2}{2},\frac{y_1+y_2}{2}\right)$ |
|
| 174 |
+
| Slope Formula | $m=\frac{y_2-y_1}{x_2-x_1}$,etc. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
---
|
| 177 |
+
# Example Usage
|
|
|
|
| 178 |
|
| 179 |
## Example 1
|
| 180 |
|
| 181 |
**Input**
|
|
|
|
| 182 |
```text
|
| 183 |
Solve:
|
|
|
|
| 184 |
2x+7=19
|
| 185 |
```
|
|
|
|
| 186 |
**Output**
|
|
|
|
| 187 |
```text
|
| 188 |
Subtract 7 from both sides.
|
|
|
|
| 189 |
2x=12
|
|
|
|
| 190 |
Divide both sides by 2.
|
|
|
|
| 191 |
x=6
|
| 192 |
```
|
|
|
|
| 193 |
---
|
| 194 |
|
| 195 |
## Example 2
|
| 196 |
|
| 197 |
**Input**
|
|
|
|
| 198 |
```text
|
| 199 |
Find the derivative of
|
|
|
|
| 200 |
f(x)=x²+5x+2
|
| 201 |
```
|
|
|
|
| 202 |
**Output**
|
|
|
|
| 203 |
```text
|
| 204 |
Using the power rule,
|
|
|
|
| 205 |
f'(x)=2x+5
|
| 206 |
```
|
|
|
|
| 207 |
---
|
|
|
|
| 208 |
## Example 3
|
| 209 |
|
| 210 |
**Input**
|
|
|
|
| 211 |
```text
|
| 212 |
Find the area of a circle with radius 7.
|
| 213 |
```
|
|
|
|
| 214 |
**Output**
|
|
|
|
| 215 |
```text
|
| 216 |
A=\pi r^2
|
|
|
|
| 217 |
A=49\pi
|
|
|
|
| 218 |
≈153.94
|
| 219 |
```
|
| 220 |
```text
|
|
|
|
| 226 |
/_____|
|
| 227 |
a
|
| 228 |
```
|
|
|
|
| 229 |
---
|
| 230 |
```text
|
| 231 |
y
|
|
|
|
| 238 |
-1 │
|
| 239 |
-2 │
|
| 240 |
```
|
|
|
|
|
|
|
| 241 |
---
|
| 242 |
|
| 243 |
# Inference with Transformers
|
|
|
|
| 245 |
```python
|
| 246 |
from transformers import AutoTokenizer
|
| 247 |
from transformers import AutoModelForCausalLM
|
|
|
|
| 248 |
model_name = "Charlie890/Adaptive-Math-Reasoner-Mixtral-8x7B"
|
|
|
|
| 249 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
|
| 250 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
|
|
|
| 251 |
prompt = "Solve: 3x + 5 = 20"
|
|
|
|
| 252 |
inputs = tokenizer(prompt, return_tensors="pt")
|
|
|
|
| 253 |
outputs = model.generate(
|
| 254 |
**inputs,
|
| 255 |
max_new_tokens=256
|
| 256 |
)
|
|
|
|
| 257 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 258 |
```
|
| 259 |
|