---
base_model: unsloth/phi-3-mini-4k-instruct-bnb-4bit
language:
- en
- ig
tags:
- text-generation-inference
- transformers
- unsloth
- phi-3
- igbo
- nlp
- translation
- chatbot
- safetensors
datasets:
- ccibeekeoc42/english_to_igbo
- nkowaokwu/ibo-dict
- HuggingFaceH4/ultrachat_200k
---
# 🤖 Igbo-Phi3-Bilingual-Chat (Master Weights)

[](https://github.com/unslothai/unsloth)
**A specialized bilingual AI assistant trained to converse fluently in Igbo and English.**
This is the **full-precision merged model** (SafeTensors format). It contains the complete fine-tuned weights of the Microsoft Phi-3 Mini model, optimized for Igbo language understanding, translation, and cultural context.
---
## 🚀 Usage (Python / Transformers)
To use this model in a Python script using Hugging Face Transformers:
### 1. Install Dependencies
```bash
pip install transformers torch accelerate
````
### 2\. Inference Code
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "nwokikeonyeka/Igbo-Phi3-Bilingual-Chat-v1-merged"
# Load the model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16, # Use float16 to save memory
device_map="auto",
trust_remote_code=True
)
# Define a prompt (Bilingual Chat)
user_input = "Kedu ka m ga-esi sị 'Good morning' n'asụsụ Igbo?"
# Format with the correct Phi-3 template
prompt = f"<|user|>\n{user_input}<|end|>\n<|assistant|>\n"
# Tokenize and Generate
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(
**inputs,
max_new_tokens=128,
temperature=0.3
)
# Decode result
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)
```
-----
## 📚 Training Data
This model was trained on a robust mix of **700,000+ examples** to ensure it can translate accurately while remaining a smart chatbot:
1. **Fluency (522k pairs):** [ccibeekeoc42/english\_to\_igbo](https://huggingface.co/datasets/ccibeekeoc42/english_to_igbo)
* *Sentence-level translation pairs.*
2. **Vocabulary (5k definitions):** [nkowaokwu/ibo-dict](https://huggingface.co/datasets/nkowaokwu/ibo-dict) (Text only)
* *Deep dictionary definitions for semantic understanding.*
3. **General Memory (200k chats):** [HuggingFaceH4/ultrachat\_200k](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k)
* *General English conversation to prevent "catastrophic forgetting" of logic and reasoning.*
-----
## ⚙️ Training Details
* **Base Architecture:** Microsoft Phi-3 Mini 4K Instruct
* **Framework:** Unsloth (LoRA) + Hugging Face TRL
* **Epochs:** 1 full pass over combined data.
* **Max Sequence Length:** 2048 tokens.
* **Optimizer:** AdamW 8-bit.
-----
*Developed by **nwokikeonyeka** using the [Unsloth](https://unsloth.ai) library for faster fine-tuning.*