Text Generation
Transformers
Safetensors
English
qwen3
math
reasoning
olympiad-math
supervised-fine-tuning
lora
cs-552
conversational
text-generation-inference
Instructions to use cs-552-2026-group1/math_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cs-552-2026-group1/math_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cs-552-2026-group1/math_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cs-552-2026-group1/math_model") model = AutoModelForCausalLM.from_pretrained("cs-552-2026-group1/math_model") 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 cs-552-2026-group1/math_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cs-552-2026-group1/math_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cs-552-2026-group1/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cs-552-2026-group1/math_model
- SGLang
How to use cs-552-2026-group1/math_model 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 "cs-552-2026-group1/math_model" \ --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": "cs-552-2026-group1/math_model", "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 "cs-552-2026-group1/math_model" \ --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": "cs-552-2026-group1/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cs-552-2026-group1/math_model with Docker Model Runner:
docker model run hf.co/cs-552-2026-group1/math_model
| license: mit | |
| language: | |
| - en | |
| base_model: Qwen/Qwen3-1.7B | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| tags: | |
| - qwen3 | |
| - math | |
| - reasoning | |
| - olympiad-math | |
| - supervised-fine-tuning | |
| - lora | |
| - cs-552 | |
| datasets: | |
| - EleutherAI/hendrycks_math | |
| - open-r1/OpenR1-Math-220k | |
| - AI-MO/NuminaMath-CoT | |
| metrics: | |
| - accuracy | |
| # Math Model — Olympiad-Focused SFT Checkpoint | |
| This model is a fine-tuned version of **Qwen/Qwen3-1.7B** for mathematical reasoning, developed for the CS-552 standard project math track. | |
| The model was trained to solve competition-style mathematics problems and produce final answers in boxed LaTeX format. | |
| ## Base Model | |
| - Base model: `Qwen/Qwen3-1.7B` | |
| - Fine-tuning method: LoRA supervised fine-tuning | |
| - Target task: mathematical reasoning and short-answer competition problems | |
| ## Training Data | |
| The final submitted checkpoint was trained on approximately **25,165** examples from hard mathematical reasoning datasets: | |
| | Dataset / Source | Examples | | |
| |---|---:| | |
| | Hendrycks MATH | 4,759 | | |
| | OpenR1-Math-220k | 7,999 | | |
| | NuminaMath-CoT | 12,407 | | |
| | **Total** | **25,165** | | |
| The NuminaMath subset was filtered to focus on harder mathematical sources: | |
| - Olympiads | |
| - AoPS Forum | |
| - AMC/AIME | |
| - MATH | |
| The OpenR1 subset was filtered to competition-relevant categories: | |
| - Algebra | |
| - Geometry | |
| - Number Theory | |
| - Combinatorics | |
| - Inequalities | |
| ## Training Details | |
| | Setting | Value | | |
| |---|---| | |
| | Base model | Qwen/Qwen3-1.7B | | |
| | Fine-tuning method | LoRA | | |
| | Epochs | 1 | | |
| | LoRA rank | 32 | | |
| | LoRA alpha | 64 | | |
| | LoRA dropout | 0.05 | | |
| | Learning rate | 1e-4 | | |
| | Batch size | 1 | | |
| | Gradient accumulation steps | 8 | | |
| | Precision | bfloat16 | | |
| | Hardware | 1 × NVIDIA A100 40GB | | |
| | Training steps | 3,146 | | |
| | Runtime | 6,761 seconds | | |
| | Tokens processed | 14.7M | | |
| | Final training loss | 0.6114 | | |
| | Mean token accuracy | 0.8302 | | |
| ## Generation Configuration | |
| The submitted generation configuration uses sampling: | |
| ```json | |
| { | |
| "do_sample": true, | |
| "temperature": 0.25, | |
| "top_p": 0.85, | |
| "top_k": 30 | |
| } |