Model Card for Model ID

This is the merged version of LoRAfrica and base Phi4 Model

  • Base Model: microsoft/Phi-4-mini-instruct
  • Lora Model: DannyAI/phi4_african_history_lora_ds2_axolotl

Model Details

Model Description

This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.

  • Developed by: Daniel Ihenacho
  • Funded by: Daniel Ihenacho
  • Shared by: Daniel Ihenacho
  • Model type: Text Generation
  • Language(s) (NLP): English
  • License: mit
  • LoRA Model: DannyAI/phi4_african_history_lora_ds2_axolotl
  • Base Model: microsoft/Phi-4-mini-instruct

Uses

This can be used for QA datasets about African History

Out-of-Scope Use

Can be used beyond African History but should not.

How to Get Started with the Model

from transformers import pipeline
from transformers import (
    AutoTokenizer, 
    AutoModelForCausalLM)

model_id = "DannyAI/phi4_african_history_lora_ds2_axolotl_merged"

tokeniser = AutoTokenizer.from_pretrained(model_id)

# load merged model
model  = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map = "auto",
    torch_dtype = torch.bfloat16,
    trust_remote_code = False
)

generator = pipeline(
    "text-generation",
    model=model,
    tokenizer=tokeniser,
)
question = "What is the significance of African feminist scholarly activism in contemporary resistance movements?"
def generate_answer(question)->str:
    """Generates an answer for the given question using the fine-tuned LoRA model.
    """
    messages = [
        {"role": "system", "content": "You are a helpful AI assistant specialised in African history which gives concise answers to questions asked."},
        {"role": "user", "content": question}
    ]
    
    output = generator(
        messages, 
        max_new_tokens=2048, 
        temperature=0.1, 
        do_sample=False,
        return_full_text=False
    )
    return output[0]['generated_text'].strip()
# Example output
African feminist scholarly activism is significant in contemporary resistance movements as it provides a critical framework for understanding and addressing the specific challenges faced by African women in the context of global capitalism, neocolonialism, and patriarchal structures.

Citation

If you use this dataset, please cite:

@Model{
Ihenacho2026phi4_african_history_lora_ds2_axolotl_merged,
  author    = {Daniel Ihenacho},
  title     = {phi4_african_history_lora_ds2_axolotl_merged},
  year      = {2026},
  publisher = {Hugging Face Models},
  url       = {https://huggingface.co/DannyAI/phi4_african_history_lora_ds2_axolotl_merged},
  urldate   = {2026-03-21},
}

Model Card Authors

Daniel Ihenacho

Model Card Contact

Downloads last month
7
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for DannyAI/phi4_african_history_lora_ds2_axolotl_merged

Dataset used to train DannyAI/phi4_african_history_lora_ds2_axolotl_merged