Views
No views yet
Qwen/Qwen2.5-Math-1.5B| Model | Greedy (%) | Maj@8 (%) | Notes |
|---|---|---|---|
| Qwen2.5-Math-1.5B-Instruct | 84.8 | 89.5 | Reported settings |
| Qwen2.5-Math-1.5B-TreeRPO | 86.4 | 89.6 | Same decoding (temp 0 / (0.7, 0.8)) |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model_name = "omrisap/TreeRPO-Qwen2.5-Math-1.5B"
5tok = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
7
8messages = [
9 {"role": "system", "content": "You are a helpful math reasoning assistant. Provide step-by-step reasoning and put the final answer in \\boxed{}."},
10 {"role": "user", "content": "If 3x + 5 = 17, what is x?"}
11]
12
13prompt_text = tok.apply_chat_template(
14 messages,
15 tokenize=False,
16 add_generation_prompt=True
17)
18
19inputs = tok(prompt_text, return_tensors="pt").to(model.device)
20outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.0)
21print(tok.decode(outputs[0], skip_special_tokens=True))