This model card provides detailed information about the LLaMA-3.1-8B model fine-tuned for South African languages. The model demonstrates cost-effective cross-lingual transfer learning for African language processing.
The model is based on Meta's LLaMA-3.1-8B-Instruct architecture and has been fine-tuned on translated versions of the Alpaca Cleaned dataset. The training approach leverages machine translation to create instruction-tuning data in five South African languages, making it a cost-effective solution for multilingual AI development.
The training data was created by translating the Alpaca Cleaned dataset into five target languages:
Machine translation was used to generate the training data, with a cost of $370 per language.
The model was trained using the PEFT (Parameter-Efficient Fine-Tuning) library on the Akash Compute Network. Key aspects of the training process include:
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3# Load the model and tokenizer
4model_name = "meta-llama/llama-8b-south-africa"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(model_name)
7
8# Example usage for text generation
9text = "Translate to Xhosa: Hello, how are you?"
10inputs = tokenizer(text, return_tensors="pt")
11outputs = model.generate(**inputs, max_length=50)
12result = tokenizer.decode(outputs[0], skip_special_tokens=True)
13print(result)
This model is released under the Apache 2.0 license. The full license text can be found at
https://www.apache.org/licenses/LICENSE-2.0.txt