Views
No views yet
meta-llama/Llama-3.2-1B-Instruct for mathematical reasoning.torchrun --nproc_per_node=2nvidia/OpenMathInstruct-2meta-math/MetaMathQATIGER-Lab/MathInstructAI-MO/NuminaMath-CoT| Benchmark | Accuracy |
|---|---|
| GSM8K test | 50.57% |
| MATH-500 test | 28.80% |
| Combined average | 39.68% |
1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name="Kiffaz11/llama-3.2-1b-instruct-math-sft-lora",
5 max_seq_length=4096,
6 dtype=None,
7 load_in_4bit=False,
8)
9
10FastLanguageModel.for_inference(model)
11
12messages = [
13 {
14 "role": "user",
15 "content": "Solve step by step. Put the final answer in \\boxed{}. What is 17*23?",
16 }
17]
18
19inputs = tokenizer.apply_chat_template(
20 messages,
21 tokenize=True,
22 add_generation_prompt=True,
23 return_tensors="pt",
24 return_dict=True,
25).to(model.device)
26
27outputs = model.generate(
28 **inputs,
29 max_new_tokens=256,
30 do_sample=False,
31)
32
33print(
34 tokenizer.decode(
35 outputs[0][inputs["input_ids"].shape[-1]:],
36 skip_special_tokens=True,
37 )
38)