Instructions to use luminaudoabba/llama3-naijaweb-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use luminaudoabba/llama3-naijaweb-merged with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("luminaudoabba/llama3-naijaweb-merged", device_map="auto") - PEFT
How to use luminaudoabba/llama3-naijaweb-merged with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use luminaudoabba/llama3-naijaweb-merged with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for luminaudoabba/llama3-naijaweb-merged to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for luminaudoabba/llama3-naijaweb-merged to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for luminaudoabba/llama3-naijaweb-merged to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="luminaudoabba/llama3-naijaweb-merged", max_seq_length=2048, )
NaijaLLaMA-8B (QLoRA Adapter)
Overview
This repository contains the LoRA adapter weights for NaijaLLaMA-8B, a parameter-efficient fine-tuned variant of LLaMA-3.1-8B adapted for Nigerian English and Nigerian Pidgin contexts.
The base model used was:
unsloth/llama-3.1-8b-bnb-4bit
Fine-tuning was performed using QLoRA via the Unsloth framework and Hugging Face TRL.
⚠️ This repository contains LoRA adapter weights only, not the full merged model.
Motivation
Large language models are predominantly trained on Western-centric corpora and may underperform on culturally grounded Nigerian expressions and Pidgin syntax.
This work investigates whether conservative, low-rank QLoRA adaptation on a small Nigerian corpus (12,000 samples) can induce measurable contextual alignment under strict hardware constraints (single Tesla T4, 16GB VRAM).
This model accompanies the paper:
Low-resource Fine-Tuning of LLaMA-3.1 using QLoRA for Nigerian Language Contexts
Training Configuration
Dataset
- Source:
saheedniyi/naijaweb - Subset size: 12,000 training samples
- Validation set: 500 samples
- Composition (approximate):
- Nigerian English (45%)
- Nigerian Pidgin (30%)
- Code-switched text (25%)
Hardware
- Platform: Kaggle
- GPU: Tesla T4 (16GB VRAM)
Fine-Tuning Method
- Technique: QLoRA (4-bit NF4 quantization)
- Target modules:
q_projk_projv_projo_proj
Hyperparameters
- LoRA rank (r): 64
- LoRA alpha (α): 16
- Dropout: 0
- Optimizer: AdamW (8-bit)
- Learning rate: 2e-4 (linear decay)
- Batch size: 2
- Gradient accumulation: 8
- Effective batch size: 16
- Epochs: 1
- Max sequence length: 1024
- Random seed: 42
Training Behavior
Training loss decreased from approximately 2.04 to 1.98 over one epoch, indicating stable optimization under conservative scaling.
Perplexity on the held-out validation subset reduced from 8.20 (base) to 7.38 (fine-tuned).
Note: This model is an exploratory academic artifact. Improvements are modest and primarily observed in culturally grounded prompts.
Usage
Load the base model and attach the adapters:
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="unsloth/llama-3.1-8b-bnb-4bit",
max_seq_length=1024,
load_in_4bit=True,
)
model.load_adapter("luminaudoabba/llama3-naijaweb-merged")
model.enable_adapter_layers()