PEFT
Safetensors
lora
trl
chatml
caracal

Caracal Instruct v2

This model is a fine-tuned LoRA adapter for the Caracal African LLM, optimized for instruction-following and dialogue using the ChatML format.

Model Details

  • Developer: theophilusowiti
  • Model Type: PEFT LoRA Adapter (Causal Language Model)
  • Base Model: theophilusowiti/Caracal_GPT
  • Languages Supported: English (en), Swahili (swa), Amharic (amh), Luganda (lug), Kinyarwanda (kin), Hausa (hau), Yoruba (yor), Igbo (ibo), and Lingala (lin).
  • License: Apache 2.0

Training Data & Metrics

  • Dataset: Trained on the newly published theophilusowiti/Caracal_Instruct_Dataset. See the dataset card for specific data splits and sources.
  • Training Method: Parameter-Efficient Fine-Tuning (PEFT) using LoRA via the trl SFTTrainer.
  • Training Run & Losses: Full training metrics, loss curves, and hardware usage are logged to Weights & Biases (wandb).

How to Use

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model_id = "theophilusowiti/Caracal_GPT"
adapter_id = "theophilusowiti/Caracal_instruct_v2"

tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id, 
    torch_dtype=torch.bfloat16, 
    device_map="auto"
)

model = PeftModel.from_pretrained(base_model, adapter_id)

messages = [
    {"role": "system", "content": "You are a helpful AI assistant."},
    {"role": "user", "content": "Who is the president of Kenya?"}
]
inputs = tokenizer.apply_chat_template(
    messages, 
    return_tensors="pt", 
    add_generation_prompt=True
).to(model.device)

outputs = model.generate(inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for theophilusowiti/Caracal_instruct_v2

Adapter
(1)
this model

Dataset used to train theophilusowiti/Caracal_instruct_v2