Downloads · 30 days
16
27% of all-time downloads
Dineochiloane/gemma-3-4b-isizulu-simple
gemma-3-4b-isizulu-simple is a machine learning model from Dineochiloane. 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 peft. The card lists the license as gemma.
Simple and focused isiZulu to English translation model using consistent prompting.
Downloads · 30 days
16
27% of all-time downloads
All-time downloads
59
Public
Repo size
9 GB
Likes
0
Public
Click a slice to open those files.
.safetensors3 GB · 99%
From the Hugging Face model README
Simple and focused isiZulu to English translation model using consistent prompting.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load model
base_model = AutoModelForCausalLM.from_pretrained("google/gemma-3-4b-it")
tokenizer = AutoTokenizer.from_pretrained("google/gemma-3-4b-it")
model = PeftModel.from_pretrained(base_model, "Dineochiloane/gemma-3-4b-isizulu-simple")
# Translate
messages = [{"role": "user", "content": "Translate this from isiZulu to English: Ngiyabonga kakhulu"}]
input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt")
outputs = model.generate(input_ids, max_new_tokens=50, repetition_penalty=1.2)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)