Downloads · 30 days
9
7% of all-time downloads
sula15/SinhaLM-Gemma-3-4b-it
SinhaLM-Gemma-3-4b-it is a text generation model from sula15. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
A LoRA fine-tuned instruction-following version of Google's Gemma-3-4b-it model specifically optimized for Sinhala language tasks using the Sinhala FLAN dataset.
Downloads · 30 days
9
7% of all-time downloads
All-time downloads
124
Public
Repo size
169 MB
Likes
0
Public
Click a slice to open those files.
.safetensors131 MB · 77%
From the Hugging Face model README
A LoRA fine-tuned instruction-following version of Google's Gemma-3-4b-it model specifically optimized for Sinhala language tasks using the Sinhala FLAN dataset.
This model is a Parameter-Efficient Fine-Tuning (PEFT) adaptation of Google's Gemma-3-4b-it using Low-Rank Adaptation (LoRA) technique. The model has been instruction-tuned on the Sinhala FLAN dataset to improve performance on instruction-following tasks in Sinhala language while maintaining English capabilities. The training focused on enhancing the model's ability to understand and respond to instructions in Sinhala.
This model is designed for instruction-following tasks in Sinhala language, including:
The model can be further fine-tuned for specific Sinhala NLP tasks such as:
This model is not suitable for:
The model was trained on the Sinhala FLAN dataset (0xAIT/sinhala-flan), which contains instruction-following examples in Sinhala. The FLAN (Finetuned Language Models are Zero-Shot Learners) methodology focuses on improving instruction-following capabilities through diverse task formatting. Due to computational constraints, training was performed on a subset of 50,000 samples from the original dataset of 2,263,067 samples.
| Step | Training Loss | Validation Loss |
|---|---|---|
| 500 | 6.172 | 1.522 |
| 1000 | 5.782 | 1.440 |
The model showed consistent improvement in both training and validation loss throughout the training process.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model and tokenizer
base_model = AutoModelForCausalLM.from_pretrained("google/gemma-3-4b-it")
tokenizer = AutoTokenizer.from_pretrained("google/gemma-3-4b-it")
# Load the LoRA adapter
model = PeftModel.from_pretrained(base_model, "sula15/SinhaLM-Gemma-3-4b-it")
# Generate text
inputs = tokenizer("ප්රශ්නය: ", return_tensors="pt")
outputs = model.generate(**inputs, max_length=100, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Sulakna Weerasinghe
If you use this model, please cite:
@model{weerasinghe2025sinhalm,
title={SinhaLM-Gemma-3-4b-it: A LoRA-adapted Gemma model for Sinhala instruction-following},
author={Weerasinghe, Sulakna and Gunathunga, Ovindu and Edirisuriya, Supun and Bopitiya, Sayuru},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/sula15/SinhaLM-Gemma-3-4b-it}
}