Downloads · 30 days
0
Nrex/lfm2-math-finetuned
lfm2-math-finetuned is a machine learning model from Nrex. 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 transformers.
This is a LoRA fine-tuned version of the LiquidAI/LFM2-350M-Math model on the HuggingFaceH4/MATH-500 dataset. The model is designed to answer math questions and generate step-by-step solutions in natural language.
Downloads · 30 days
0
Access
Public
Updated Sep 27, 2025
Repo size
697 KB
Likes
0
Public
Click a slice to open those files.
.json4.8 MB · 87%
From the Hugging Face model README
This is a LoRA fine-tuned version of the LiquidAI/LFM2-350M-Math model on the HuggingFaceH4/MATH-500 dataset.
The model is designed to answer math questions and generate step-by-step solutions in natural language.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = "LiquidAI/LFM2-350M-Math"
adapter_repo = "Nrex/lfm2-math-finetuned"
tokenizer = AutoTokenizer.from_pretrained(adapter_repo)
model = AutoModelForCausalLM.from_pretrained(base_model)
model = PeftModel.from_pretrained(model, adapter_repo)
inputs = tokenizer("What is 12*13?", return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))