Text Generation
Transformers
English
gpt_oss
text-generation-inference
unsloth
mathematics
olympiad-math
reasoning
chain-of-thought
conversational
Instructions to use Azmainadeeb/MathGPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Azmainadeeb/MathGPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Azmainadeeb/MathGPT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Azmainadeeb/MathGPT") model = AutoModelForCausalLM.from_pretrained("Azmainadeeb/MathGPT") 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 Azmainadeeb/MathGPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Azmainadeeb/MathGPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Azmainadeeb/MathGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Azmainadeeb/MathGPT
- SGLang
How to use Azmainadeeb/MathGPT 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 "Azmainadeeb/MathGPT" \ --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": "Azmainadeeb/MathGPT", "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 "Azmainadeeb/MathGPT" \ --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": "Azmainadeeb/MathGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Azmainadeeb/MathGPT with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Azmainadeeb/MathGPT to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Azmainadeeb/MathGPT to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Azmainadeeb/MathGPT to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Azmainadeeb/MathGPT", max_seq_length=2048, ) - Docker Model Runner
How to use Azmainadeeb/MathGPT with Docker Model Runner:
docker model run hf.co/Azmainadeeb/MathGPT
Update README.md
Browse files
README.md
CHANGED
|
@@ -5,17 +5,74 @@ tags:
|
|
| 5 |
- transformers
|
| 6 |
- unsloth
|
| 7 |
- gpt_oss
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
license: apache-2.0
|
| 9 |
language:
|
| 10 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
-
#
|
| 14 |
|
| 15 |
-
- **
|
| 16 |
-
- **License:** apache-2.0
|
| 17 |
-
- **Finetuned from model :** unsloth/gpt-oss-120b-unsloth-bnb-4bit
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
- transformers
|
| 6 |
- unsloth
|
| 7 |
- gpt_oss
|
| 8 |
+
- mathematics
|
| 9 |
+
- olympiad-math
|
| 10 |
+
- reasoning
|
| 11 |
+
- chain-of-thought
|
| 12 |
license: apache-2.0
|
| 13 |
language:
|
| 14 |
- en
|
| 15 |
+
datasets:
|
| 16 |
+
- HuggingFaceH4/Multilingual-Thinking
|
| 17 |
+
- brando/olympiad-bench-imo-math-boxed-825-v2-21-08-2024
|
| 18 |
+
- Goedel-LM/MathOlympiadBench
|
| 19 |
+
- hf-imo-colab/olympiads-ref-base-math-word
|
| 20 |
---
|
| 21 |
|
| 22 |
+
# GPT-OSS-120B Olympiad Reasoning
|
| 23 |
|
| 24 |
+
This model is a specialized fine-tune of **OpenAI's GPT-OSS 120B** (4-bit quantized by Unsloth). It is designed for high-level mathematical reasoning, complex problem solving, and long-form "Thinking" processes.
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
- **Developed by:** Azmainadeeb
|
| 27 |
+
- **Base Model:** unsloth/gpt-oss-120b-unsloth-bnb-4bit
|
| 28 |
+
- **Architecture:** Mixture-of-Experts (MoE) with 117B total and 5.1B active parameters.
|
| 29 |
+
- **License:** Apache-2.0
|
| 30 |
|
| 31 |
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
| 32 |
+
|
| 33 |
+
## 🌟 Model Highlights
|
| 34 |
+
This model uses the **Harmony Response Format** natively, allowing for a distinct separation between "internal reasoning" and "final response." By fine-tuning on a mixture of thinking traces and competition-grade math, the model exhibits improved logical consistency and accuracy in STEM domains.
|
| 35 |
+
|
| 36 |
+
### Capabilities:
|
| 37 |
+
* **Deep Reasoning:** Leverages the `Multilingual-Thinking` dataset to maintain a coherent chain-of-thought.
|
| 38 |
+
* **Competition Math:** Optimized for International Mathematical Olympiad (IMO) and AIME-style problems.
|
| 39 |
+
* **Variable Effort:** Supports the `reasoning_effort` parameter (low, medium, high) to balance speed and accuracy.
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
## 📊 Training Data
|
| 44 |
+
The model was trained on a high-diversity mixture of reasoning and mathematical datasets:
|
| 45 |
+
|
| 46 |
+
1. **[HuggingFaceH4/Multilingual-Thinking](https://huggingface.co/datasets/HuggingFaceH4/Multilingual-Thinking):** Provides the foundational "thinking" behavior and internal monologue.
|
| 47 |
+
2. **[brando/olympiad-bench-imo-math](https://huggingface.co/datasets/brando/olympiad-bench-imo-math-boxed-825-v2-21-08-2024):** High-difficulty math competition problems.
|
| 48 |
+
3. **[Goedel-LM/MathOlympiadBench](https://huggingface.co/datasets/Goedel-LM/MathOlympiadBench):** Challenging math benchmark problems.
|
| 49 |
+
4. **[hf-imo-colab/olympiads-ref-base-math-word](https://huggingface.co/datasets/hf-imo-colab/olympiads-ref-base-math-word):** Diverse word problems and solutions.
|
| 50 |
+
5. **Kaggle External Math Data:** Curated datasets from AoPS, AIMO, and OlympiadBench for extra-domain coverage.
|
| 51 |
+
|
| 52 |
+
## 🛠 Usage Instructions
|
| 53 |
+
This model is optimized for use with the **Unsloth** library and Hugging Face's `transformers`.
|
| 54 |
+
|
| 55 |
+
### Quick Inference Example
|
| 56 |
+
```python
|
| 57 |
+
from unsloth import FastLanguageModel
|
| 58 |
+
import torch
|
| 59 |
+
|
| 60 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 61 |
+
model_name = "Azmainadeeb/gpt-oss-120b-olympiad", # Replace with your repo ID
|
| 62 |
+
max_seq_length = 2048,
|
| 63 |
+
load_in_4bit = True,
|
| 64 |
+
)
|
| 65 |
+
|
| 66 |
+
messages = [
|
| 67 |
+
{"role": "user", "content": "Let n be a positive integer such that n^2 + 3n + 2 is a perfect square. Find all such n."}
|
| 68 |
+
]
|
| 69 |
+
|
| 70 |
+
input_ids = tokenizer.apply_chat_template(
|
| 71 |
+
messages,
|
| 72 |
+
add_generation_prompt = True,
|
| 73 |
+
reasoning_effort = "medium", # Options: low, medium, high
|
| 74 |
+
return_tensors = "pt"
|
| 75 |
+
).to("cuda")
|
| 76 |
+
|
| 77 |
+
outputs = model.generate(input_ids, max_new_tokens = 1024)
|
| 78 |
+
print(tokenizer.decode(outputs[0]))
|