Edit model card

Excited to announce the release of Llama3-8b-Naija_v1 a finetuned version of Meta-Llama-3-8B trained on a Question - Answer dataset from Nairaland. The model was built in an attempt to "Nigerialize" Llama-3, giving it a Nigerian - like behavior.

Model Details

Model Description

Model Sources

How to Get Started with the Model

Use the code below to get started with the model.

#necessary installations
!pip install bitsandbytes peft accelerate

from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("saheedniyi/Llama3-8b-Naija_v1")
model = AutoModelForCausalLM.from_pretrained("saheedniyi/Llama3-8b-Naija_v1")

input_text = "What are the top places for tourism in Nigeria?"
formatted_prompt = f"### BEGIN CONVERSATION ###\n\n## User: ##\n{input_text}\n\n## Assistant: ##\n"
inputs = tokenizer(formatted_prompt, return_tensors="pt")
outputs = model.generate(**inputs.to("cuda"), max_new_tokens=512,pad_token_id=tokenizer.pad_token_id,do_sample=True,temperature=0.6,top_p=0.9,)
response=tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)

when using the model it is important to use the chat template that the model was trained on.

prompt = "INPUT YOUR PROMPT HERE"
formatted_prompt=f"### BEGIN CONVERSATION ###\n\n## User: ##\n{prompt}\n\n## Assistant: ##\n"

The model has a little tokenization issue and it's necessary to wtrite a function to clean the output to make it cleaner and more presentable.

def split_response(text):
  return text.split("### END CONVERSATION")[0]

cleaned_response=split_response(response)
print(cleaned_response)

This issue shold be resolved in the next version of the model.

Downloads last month
28
Safetensors
Model size
4.65B params
Tensor type
FP16
·
F32
·
U8
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Dataset used to train saheedniyi/Llama3-8b-Naija_v1