Downloads · 30 days
116
41% of all-time downloads
DannyAI/phi4_african_history_lora_ds2_axolotl_merged
phi4_african_history_lora_ds2_axolotl_merged is a text generation model from DannyAI. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This is the merged version of LoRAfrica and base Phi4 Model - Base Model: microsoft/Phi-4-mini-instruct - Lora Model: DannyAI/phi4africanhistorylorads2axolotl
Downloads · 30 days
116
41% of all-time downloads
All-time downloads
281
Public
Parameters
3.8B
7.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors7.7 GB · 100%
From the Hugging Face model README
This is the merged version of LoRAfrica and base Phi4 Model
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
This can be used for QA datasets about African History
Can be used beyond African History but should not.
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.
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},
}
Daniel Ihenacho