Views
No views yet
\boxed{...}. This is the shipped model of the MathNano
project — built end-to-end on a single RTX 4090 for ~£13.| Benchmark | Accuracy |
|---|---|
| GSM8K | 39.0% |
| MATH | 40.0% |
#### extraction + numeric/symbolic equivalence).1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B")
5model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B", torch_dtype="auto")
6model = PeftModel.from_pretrained(model, "adimunot/mathnano-qwen1.5b-sft")
7
8msgs = [
9 {"role": "system", "content": "You are a careful mathematician. Solve the problem step by step, then give the final answer in \\boxed{}."},
10 {"role": "user", "content": "If 5x - 3 = 12, what is the value of 5x + 3?"},
11]
12prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
13ids = tok(prompt, return_tensors="pt").to(model.device)
14out = model.generate(**ids, max_new_tokens=384, eos_token_id=tok.convert_tokens_to_ids("<|im_end|>"))
15print(tok.decode(out[0, ids.input_ids.shape[1]:], skip_special_tokens=True))eos_token_id to <|im_end|> so it stops right after the answer.\boxed{...}.RESULTS.md for the post-mortem. Use this SFT checkpoint, not the GRPO one.