Downloads · 30 days
10
3% of all-time downloads
Kiffaz11/llama-3.2-1b-instruct-math-sft-lora
llama-3.2-1b-instruct-math-sft-lora is a machine learning model from Kiffaz11. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as llama3.2.
This is a LoRA adapter fine-tuned from meta-llama/Llama-3.2-1B-Instruct for mathematical reasoning.
Downloads · 30 days
10
3% of all-time downloads
All-time downloads
318
Public
Repo size
198 MB
Likes
0
Public
Click a slice to open those files.
.safetensors180 MB · 91%
From the Hugging Face model README
This is a LoRA adapter fine-tuned from meta-llama/Llama-3.2-1B-Instruct for mathematical reasoning.
torchrun --nproc_per_node=2nvidia/OpenMathInstruct-2meta-math/MetaMathQATIGER-Lab/MathInstructAI-MO/NuminaMath-CoTExact decontamination was applied against GSM8K test and MATH-500 test question text hashes.
| Benchmark | Accuracy |
|---|---|
| GSM8K test | 50.57% |
| MATH-500 test | 28.80% |
| Combined average | 39.68% |
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="Kiffaz11/llama-3.2-1b-instruct-math-sft-lora",
max_seq_length=4096,
dtype=None,
load_in_4bit=False,
)
FastLanguageModel.for_inference(model)
messages = [
{
"role": "user",
"content": "Solve step by step. Put the final answer in \\boxed{}. What is 17*23?",
}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
return_dict=True,
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
)
print(
tokenizer.decode(
outputs[0][inputs["input_ids"].shape[-1]:],
skip_special_tokens=True,
)
)