unsloth/OpenMathReasoning-mini
Viewer • Updated • 19.3k • 3.49k • 64
This model is fine-tuned from Qwen3-4B-Base using Supervised Fine-Tuning (SFT) on the OpenMath Mini dataset.
The goal is to improve the model’s ability to solve and reason through mathematical problems in natural language.
from transformers import AutoModelForCausalLM, AutoTokenizer,TextStreamer
model_name='wesjos/SFT-Qwen3-4B-Base'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
device_map="auto",
)
prompt='Find the sum of the roots of the equation \((x+6)^{1/3} + (x-2)^{1/2} = 2\).'
messages = [
{"role": "user", "content": prompt}
]
streamer= TextStreamer(tokenizer,skip_prompt=False,skip_special_tokens=False)
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([text], return_tensors="pt",add_special_tokens=True,
).to(model.device)
outputs = model.generate(
**model_inputs,
max_new_tokens=4096,
streamer=streamer,
)
Base model
Qwen/Qwen3-4B-Base