Views
No views yet
Qwen/Qwen2.5-0.5B-Instructmgbam/gaialab-naija-adapter-v0.2v0.2-development1pip install -U transformers peft accelerate torch
2
3Load the adapter with its base model:
4
5import torch
6from peft import PeftModel
7from transformers import AutoModelForCausalLM, AutoTokenizer
8
9BASE_MODEL_ID = "Qwen/Qwen2.5-0.5B-Instruct"
10ADAPTER_ID = "mgbam/gaialab-naija-adapter-v0.2"
11
12tokenizer = AutoTokenizer.from_pretrained(ADAPTER_ID)
13
14base_model = AutoModelForCausalLM.from_pretrained(
15 BASE_MODEL_ID,
16 dtype=torch.float16,
17 device_map="auto",
18)
19
20model = PeftModel.from_pretrained(
21 base_model,
22 ADAPTER_ID,
23)
24
25model.eval()
26
27messages = [
28 {
29 "role": "system",
30 "content": (
31 "You are GaiaLab Naija Assistant. Respond clearly and naturally. "
32 "Use Nigerian Pidgin when requested while preserving important "
33 "business and technical terms."
34 ),
35 },
36 {
37 "role": "user",
38 "content": (
39 "Explain in Nigerian Pidgin why small businesses should keep "
40 "proper financial records."
41 ),
42 },
43]
44
45prompt = tokenizer.apply_chat_template(
46 messages,
47 tokenize=False,
48 add_generation_prompt=True,
49)
50
51inputs = tokenizer(
52 prompt,
53 return_tensors="pt",
54).to(model.device)
55
56with torch.no_grad():
57 outputs = model.generate(
58 **inputs,
59 max_new_tokens=180,
60 temperature=0.7,
61 top_p=0.9,
62 do_sample=True,
63 repetition_penalty=1.1,
64 )
65
66generated_tokens = outputs[0][inputs["input_ids"].shape[1]:]
67
68response = tokenizer.decode(
69 generated_tokens,
70 skip_special_tokens=True,
71)
72
73print(response)
74
75For more reproducible evaluation, disable sampling:
76
77outputs = model.generate(
78 **inputs,
79 max_new_tokens=180,
80 do_sample=False,
81)
82Training Details
83Training Data
84
85The adapter was trained on the GaiaLab Naija v0.2 dataset.
86
87Dataset statistics:
88
89Item Value
90Total validated records 200
91Training records 180
92Validation records 20
93Validation ratio 10%
94Duplicate records after validation 0
95Dataset format JSONL
96Human evaluation completed No
97
98Training dataset path used during development:
99
100data/v0.2/prepared/gaialab_naija_v0.2_combined.jsonl
101
102The dataset contains instruction-response examples intended to support Nigerian-focused assistance, practical communication, business guidance, and experimental Nigerian Pidgin generation.
103
104The dataset is still small and should not be considered comprehensive or fully representative of Nigerian language use.
105
106Training Procedure
107
108The training workflow included:
109
110JSONL schema validation;
111duplicate detection;
112semantic record validation;
113deterministic seeded shuffling;
11490/10 train-validation split;
115chat-template formatting;
116LoRA fine-tuning;
117evaluation after each epoch;
118best-checkpoint selection using validation loss;
119export of the best PEFT adapter.
120Preprocessing
121
122Training and validation records were:
123
124loaded from a validated JSONL dataset;
125formatted using the Qwen chat template;
126tokenized with the base-model tokenizer;
127filtered to remove unusable examples;
128split deterministically using seed 42.
129Training Hyperparameters
130Hyperparameter Value
131Base model Qwen/Qwen2.5-0.5B-Instruct
132Epochs 3
133Learning rate 0.0002
134Per-device batch size 2
135Gradient accumulation steps 8
136Effective batch size 16
137LoRA rank 16
138LoRA alpha 32
139Random seed 42
140Validation ratio 0.10
141Evaluation frequency Every epoch
142Optimized modules q_proj, k_proj, v_proj, o_proj
143Adapter format Safetensors
144Speeds, Sizes, and Times
145Metric Value
146Training runtime 111.0862 seconds
147Training samples per second 4.861
148Training steps per second 0.324
149Global training steps 36
150Final epoch 3.0
151Reported total FLOPs 143,137,130,188,800
152Adapter weight size Approximately 8.68 MB
153Best checkpoint checkpoint-36
154Evaluation
155Testing Data, Factors, and Metrics
156Validation Data
157
158The validation set contained 20 records selected through a deterministic 90/10 split from the validated 200-record dataset.
159
160The validation data was used during training for checkpoint selection. It should not be treated as a comprehensive external benchmark.
161
162Evaluation Factors
163
164Future human evaluation should examine:
165
166Nigerian Pidgin naturalness;
167factual correctness;
168instruction following;
169cultural relevance;
170clarity;
171usefulness;
172business terminology preservation;
173code-switching quality;
174hallucination frequency;
175safety and harmful-output behavior.
176Metrics
177
178The automated training metric currently reported is cross-entropy validation loss.
179
180Validation loss measures prediction performance on the held-out validation records. A lower value indicates improved fit to the validation set, but it does not independently prove that the model produces natural Nigerian Pidgin or more useful answers.
181
182Results
183Epoch Validation Loss
1841 1.577
1852 1.423
1863 1.382963
187
188Additional final training metrics:
189
190Metric Value
191Final training loss 1.733298
192Best validation loss 1.382963
193Best checkpoint checkpoint-36
194Global step 36
195Summary
196
197Validation loss improved across all three epochs, indicating that the adapter learned from the training data.
198
199However, early qualitative testing showed that the adapter may still respond in standard English when explicitly asked to use Nigerian Pidgin. Therefore, the numerical evaluation should not be interpreted as proof of strong Nigerian Pidgin capability.
200
201A structured human evaluation comparing the base model, v0.1 adapter, and v0.2 adapter is still required.
202
203Model Examination
204
205Initial qualitative evaluation suggests that v0.2:
206
207generates concise and generally understandable responses;
208can provide practical business explanations;
209avoids obvious hallucination in some basic prompts;
210does not yet consistently follow Nigerian Pidgin instructions;
211requires additional linguistically rich training data.
212
213These observations are preliminary and are not a substitute for a formal benchmark.
214
215Environmental Impact
216
217A formal carbon-emissions estimate was not recorded for this experiment.
218
219Hardware type: CUDA-enabled cloud GPU
220Cloud provider: Google Colab
221Training duration: Approximately 111 seconds
222Compute region: Not recorded
223GPU model: Not recorded in the training summary
224Carbon emitted: Not measured
225
226Because the adapter was trained on a 0.5B-parameter base model for only 36 optimization steps, the training run was relatively small. However, no verified emissions figure is currently available.
227
228Technical Specifications
229Model Architecture and Objective
230
231The adapter modifies selected attention projection layers in Qwen2.5-0.5B-Instruct using Low-Rank Adaptation.
232
233Target modules:
234
235q_proj
236k_proj
237v_proj
238o_proj
239
240The training objective was supervised causal language modeling over instruction-response conversations.
241
242The adapter does not contain the complete base-model weights. The original Qwen base model must be loaded separately.
243
244Compute Infrastructure
245Hardware
246
247Training required a CUDA-enabled GPU. The exact GPU model was not preserved in the training summary.
248
249Software
250
251Key software components included:
252
253Python
254PyTorch
255Transformers
256PEFT
257TRL
258Datasets
259Accelerate
260Safetensors
261Framework Versions
262PEFT: 0.19.1
263Base model: Qwen2.5-0.5B-Instruct
264
265Other package versions may vary depending on the inference environment.
266
267Reproducibility
268
269The training configuration used:
270
271model: Qwen/Qwen2.5-0.5B-Instruct
272dataset: data/v0.2/prepared/gaialab_naija_v0.2_combined.jsonl
273learning_rate: 0.0002
274epochs: 3
275batch_size: 2
276gradient_accumulation: 8
277lora_rank: 16
278lora_alpha: 32
279target_modules:
280 - q_proj
281 - k_proj
282 - v_proj
283 - o_proj
284evaluation_frequency: 1
285seed: 42
286
287Training command:
288
289python train_adapter.py \
290 --config training/v0.2_config.yaml \
291 --output-dir outputs/gaialab-adapter-v0.2 \
292 --validation-ratio 0.10
293Citation
294
295No formal paper has yet been published for this model.
296
297Suggested citation:
298
299BibTeX
300@software{idiakhoa2026gaialabnaija,
301 author = {Oluwafemi Idiakhoa},
302 title = {GaiaLab Naija Adapter v0.2},
303 year = {2026},
304 organization = {GaiaLab AI},
305 publisher = {Hugging Face},
306 url = {https://huggingface.co/mgbam/gaialab-naija-adapter-v0.2}
307}
308APA
309
310Idiakhoa, O. (2026). GaiaLab Naija Adapter v0.2 [LoRA language model adapter]. GaiaLab AI. Hugging Face.
311
312Glossary
313LoRA: Low-Rank Adaptation, a parameter-efficient method for fine-tuning language models.
314PEFT: Parameter-Efficient Fine-Tuning.
315Adapter: A small set of learned weights applied to a larger base model.
316Nigerian Pidgin: A widely used English-based contact language spoken across Nigeria.
317Validation loss: A numerical measure of model prediction error on held-out data.
318Code-switching: Moving between languages or language varieties within a conversation.
319Future Work
320
321Planned improvements include:
322
323expanding the dataset beyond 200 examples;
324adding more natural Nigerian Pidgin conversations;
325improving regional and demographic coverage;
326building a dedicated evaluation benchmark;
327comparing the base model, v0.1, and v0.2 adapters;
328performing structured human evaluation;
329evaluating safety and hallucination behavior;
330documenting dataset provenance and annotation procedures;
331training a future v0.3 adapter with substantially more examples.
332Model Card Authors
333
334Oluwafemi Idiakhoa
335Founder and CEO, GaiaLab AI
336
337Model Card Contact
338
339For project information, issues, or contributions, use the GaiaLab Naija Assistant GitHub repository:
340
341https://github.com/oluwafemidiakhoa/gaialab-naija-assistant
342
343
344This version presents v0.2 honestly as a successful experimental adapter while clearly documenting that its Nigerian Pidgin performance still requires improvement and formal human evaluation.