Downloads · 30 days
19
37% of all-time downloads
Ibikemi/gemma-3-4b-african-finetuned
gemma-3-4b-african-finetuned is a question answering model from Ibikemi. Use it when the input is a question plus a passage. It is set up for peft. The card lists the license as gemma.
This model is a fine-tuned version of google/gemma-3-4b-it on three African language datasets: - AfriMGSM: Math word problems in African languages - AfriMMLU: Multiple-choice questions in African languages - AfriSenti…
Downloads · 30 days
19
37% of all-time downloads
All-time downloads
51
Public
Repo size
1.2 GB
Likes
0
Public
Click a slice to open those files.
.safetensors1 GB · 68%
From the Hugging Face model README
This model is a fine-tuned version of google/gemma-3-4b-it on three African language datasets:
pip install transformers peft torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"google/gemma-3-4b-it",
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Load LoRA adapters
model = PeftModel.from_pretrained(base_model, "Ibikemi/gemma-3-4b-african-finetuned")
tokenizer = AutoTokenizer.from_pretrained("google/gemma-3-4b-it")
# Generate
prompt = "<start_of_turn>user\nWhat is 5 + 3?<end_of_turn>\n<start_of_turn>model\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
If you use this model, please cite the original datasets:
@misc{afrimgsm,
title={AfriMGSM: African Mathematical Reasoning},
author={Masakhane},
year={2024}
}
@misc{afrimmlu,
title={AfriMMLU: African Languages MMLU},
author={Masakhane},
year={2024}
}
@misc{afrisenti,
title={AfriSenti: Sentiment Analysis for African Languages},
author={HausaNLP},
year={2023}
}
This model inherits the Gemma license from the base model.