CoolFace
Modelpublic

Bateesa/tiny-aya-global-lora-qa

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
1likes6downloads
Model Card

๐ŸŒ Multilingual SLM โ€” Ateso ยท Luganda ยท English ยท Runyankore ยท Japadhola

A lightweight, multilingual Small Language Model (SLM) fine-tuned for question-and-answer tasks across five languages spoken in Uganda and East Africa. Built on top of CohereLabs/tiny-aya-global using LoRA (PEFT), this model is optimized for low-resource, local-language understanding.


Model Details

FieldDetails
Base ModelCohereLabs/tiny-aya-global
Fine-tuning MethodLoRA (PEFT)
TaskQuestion Answering (QA)
LanguagesAteso, Luganda, English, Runyankore, Japadhola
Training Samples90K custom QA pairs
FrameworkTransformers + PEFT 0.18.1
LicenseApache 2.0

Supported Languages

LanguageCodeRegion
EnglishenInternational
LugandalugCentral Uganda
RunyankorenynWestern Uganda
AtesoteoEastern Uganda / Northern Kenya
JapadholadhoEastern Uganda

Intended Use

โœ… Direct Use

This model is designed for question-and-answer inference in multilingual East African contexts. It is suitable for:

  • โ€”Building local-language chatbots and virtual assistants
  • โ€”Educational tools for Ugandan language communities
  • โ€”Research into low-resource NLP for African languages
  • โ€”Prototyping QA systems before scaling to larger datasets

๐Ÿ”ง Downstream Use

The model can be further fine-tuned or integrated into:

  • โ€”Mobile or web-based community knowledge bases
  • โ€”Agricultural, health, or civic information systems in local languages
  • โ€”Language learning applications

โŒ Out-of-Scope Use

  • โ€”High-stakes or safety-critical applications without additional evaluation
  • โ€”Languages not covered in training (the model may produce low-quality outputs)
  • โ€”Tasks beyond question-answering (e.g., code generation, summarization) without further fine-tuning

How to Get Started

Installation

bash
pip install transformers peft torch

Inference

python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

base_model_id = "CohereLabs/tiny-aya-global"
adapter_id = "Bateesa/tiny-aya-global-lora-qa" 

tokenizer = AutoTokenizer.from_pretrained(base_model_id)
model = AutoModelForCausalLM.from_pretrained(base_model_id)
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()

def ask(question: str) -> str:
    prompt = f"Question: {question}\nAnswer:"
    inputs = tokenizer(prompt, return_tensors="pt")
    outputs = model.generate(**inputs, max_new_tokens=128)
    return tokenizer.decode(outputs[0], skip_special_tokens=True)

# English
print(ask("What is the capital of Uganda?"))

# Luganda
print(ask("Ekibuga ekikulembera Uganda kye ki?"))

# Runyankore
print(ask("Obwakabaka bw'Uganda nibuki?"))

Training Details

Training Data

  • โ€”Dataset size: 90K custom QA pairs
  • โ€”Format: Instruction-style prompt/response pairs (Question: ... \nAnswer: ...)
  • โ€”Languages: Balanced across Ateso, Luganda, English, Runyankore, and Japadhola
  • โ€”Source: Manually curated domain-specific questions and answers relevant to East African contexts

Training Procedure

Fine-tuned using LoRA (Low-Rank Adaptation) via the HuggingFace PEFT library on top of CohereLabs/tiny-aya-global.

Training Hyperparameters
ParameterValue
MethodLoRA
PEFT Version0.18.1
Training regimefp16 mixed precision
LoRA rank (r)8
LoRA alpha16
LoRA dropout0.05
Target modulesqproj, vproj
Epochs3
Batch size4
Learning rate2e-4

Evaluation

Testing Data

Held-out subset from the 90K custom QA samples, with manual review of responses across all five languages.

Metrics

  • โ€”Qualitative review: Human evaluation of answer relevance and fluency per language
  • โ€”BLEU / ROUGE: Planned for future evaluation with expanded dataset

Results

โš ๏ธ This model is trained on a small dataset of 90 samples. Performance may vary across languages and domains. It is best used as a baseline or proof-of-concept. Expanding the training dataset is strongly recommended for production use.

Bias, Risks, and Limitations

  • โ€”Small dataset (90K samples): The model may hallucinate or give incorrect answers, particularly for rare or complex questions.
  • โ€”Language imbalance: If training samples were not evenly distributed, some languages may perform better than others.
  • โ€”Cultural context: The model may not capture nuanced cultural meanings or idiomatic expressions in all five languages.
  • โ€”No safety fine-tuning: This model has not been RLHF-tuned or filtered for harmful outputs.

Recommendations

Users should validate model outputs before deploying in community-facing applications. Additional data collection and evaluation is recommended, especially for Ateso and Japadhola which have fewer NLP resources available.


Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact Calculator.

FieldDetails
Hardware TypeGPU (e.g., T4 / A100)
Training Duration~1โ€“2 hours (estimated for 90 samples)
Cloud ProviderTBD
Carbon EmittedLow (small dataset + LoRA adapter only)

Citation

If you use this model in your research or application, please cite:

bibtex
@misc{multilingual-slm-ug,
  title     = {Multilingual SLM for Ugandan Languages: Ateso, Luganda, English, Runyankore, Japadhola},
  author    = {PhosAI},
  year      = {2025},
  publisher = {HuggingFace},
  url       = {https://huggingface.co/Bateesa/tiny-aya-global-lora-qa}
}

Model Card Contact

For questions, feedback, or collaboration inquiries, please open an issue on the model repository or contact [your contact info].


Framework Versions

  • โ€”PEFT 0.18.1
  • โ€”Transformers โ‰ฅ 4.38.0
  • โ€”PyTorch โ‰ฅ 2.0