Gemma 2 Swahili Models
Collection
Gemma 2 Swahili is a family of lightweight, state-of-the-art open variants of Gemma2 models from Google, optimized for natural Swahili language unders
•
4 items
•
Updated
Gemma2-2B-Swahili-Preview is a Swahili variation of the base language model Gemma2 2B fine-tuned on the Inkuba-Mono Swahili dataset, designed to enhance Swahili language understanding through monolingual training.
The model was fine-tuned on a focused subset of the Inkuba-Mono dataset:
This model is designed for:
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("alfaxadeyembe/gemma2-2b-swahili-preview")
model = AutoModelForCausalLM.from_pretrained(
"alfaxadeyembe/gemma2-2b-swahili-preview",
device_map="auto",
torch_dtype=torch.bfloat16
)
# Set to evaluation mode
model.eval()
# Example usage
prompt = "Katika soko la Kariakoo, teknolojia mpya imewezesha"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=500,
do_sample=True,
temperature=0.7,
top_p=0.95
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
@misc{gemma2-2b-swahili-preview,
author = {Alfaxad Eyembe},
title = {Gemma2-2B-Swahili-Preview: Swahili Variation of Gemma2 2B},
year = {2025},
publisher = {Hugging Face},
journal = {Hugging Face Model Hub},
}
For questions or feedback, please reach out through: