Downloads · 30 days
0
nadaashraff/smollm2-135m-squad-lora
smollm2-135m-squad-lora is a text generation model from nadaashraff. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This is a LoRA fine-tuned version of the SmolLM2-135M model trained on 5,000 samples from the SQuAD v1.1 question-answering dataset. The goal of this fine-tune is to improve extractive question answering on short fact…
Downloads · 30 days
0
Access
Public
Updated Nov 19, 2025
Repo size
9.8 MB
Likes
0
Public
Click a slice to open those files.
.safetensors9.8 MB · 67%
From the Hugging Face model README
This is a LoRA fine-tuned version of the SmolLM2-135M model trained on 5,000 samples from the SQuAD v1.1 question-answering dataset.
The goal of this fine-tune is to improve extractive question answering on short factual passages.
HuggingFaceTB/smollm2-135mfrom transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
BASE = "HuggingFaceTB/smollm2-135m"
LORA = "nadaashraff/smollm2-135m-squad-lora"
tokenizer = AutoTokenizer.from_pretrained(BASE)
base_model = AutoModelForCausalLM.from_pretrained(BASE, device_map="auto")
model = PeftModel.from_pretrained(base_model, LORA)
prompt = """Read the following context and answer the question.
Context: Egypt ranks as the fifth worst country in the world for religious freedom. According to a 2010 Pew survey, 84% of Egyptians polled supported the death penalty for those leaving Islam.
Question: What percentage of Egyptians polled supported the death penalty for those leaving Islam?
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))