CoolFace
Modelpublic

nwokikeonyeka/Igbo-Phi3-Bilingual-Chat-v1-merged

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes22downloads
Model Card

🤖 Igbo-Phi3-Bilingual-Chat (Master Weights)

<div align="center">

Igbo-AI-Banner ![Unsloth](https://github.com/unslothai/unsloth)

</div>

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"<s><|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. 1.Fluency (522k pairs): ccibeekeoc42/english\_to\_igbo
  2. 2.Sentence-level translation pairs.
  3. 3.Vocabulary (5k definitions): nkowaokwu/ibo-dict (Text only)
  4. 4.Deep dictionary definitions for semantic understanding.
  5. 5.General Memory (200k chats): HuggingFaceH4/ultrachat\_200k
  6. 6.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.