Downloads · 30 days
11
7% of all-time downloads
omarbayoumi2/smollm-135m-genqa
smollm-135m-genqa is a text generation model from omarbayoumi2. 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.
Fine-tuned SmolLM-135M-Instruct on SQuAD v1.1 for English generative question answering.
Downloads · 30 days
11
7% of all-time downloads
All-time downloads
156
Public
Parameters
135M
538 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors538 MB · 99%
From the Hugging Face model README
Fine-tuned SmolLM-135M-Instruct on SQuAD v1.1 for English generative question answering.
This model takes a context paragraph and a question and generates a natural-language answer based on the text.
Unlike extractive QA models (e.g., BERT), this model does not select spans—it produces free-form answers using a causal language modeling head.
It is intended as a compact, educational example of fine-tuning a small (~135M parameter) generative LM for QA on Google Colab and deploying it on Hugging Face.
Trainer⚠️ Not intended for production-critical use (medical/legal/financial advice, etc.).
HuggingFaceTB/SmolLM-135M-Instructomarbayoumi2The model generates answers instead of choosing spans directly from the context.
rajpurkar/squad)Each example was converted into a generative prompt:
context: paragraphquestion: question stringanswers:Only answer tokens contribute to the training loss (prompt tokens masked with -100).
Fine-tuning was performed with the Hugging Face Trainer API.
Loss is computed over answer tokens only.
Evaluation was performed on a subset of the SQuAD v1.1 validation set using extractive metrics:
Because outputs are generative rather than span-based, metrics may underestimate correctness.
| Metric | Score (approx) |
|---|---|
| Exact Match | ~1% |
| F1 | ~9% |
This model is optimized for educational usage, not leaderboard performance.
pipelinefrom transformers import pipeline
qa = pipeline(
"text-generation",
model="omarbayoumi2/smollm-135m-genqa",
)
context = "BERT is a language representation model developed by researchers at Google."
question = "Who developed BERT?"
prompt = f"Context: {context}\n\nQuestion: {question}\n\nAnswer:"
result = qa(prompt, max_new_tokens=64, do_sample=False)[0]["generated_text"]
print(result)