This repository houses a specialized LoRA (Low-Rank Adaptation) Adapter designed specifically for fine-tuning Meta's LLaMA 3-8B Instruct version for applications involving the Galician language. The purpose of this adapter is to efficiently adapt the pre-trained model, which has been initially trained on a broad range of data and languages, to better understand and generate text in Galician.
Adapter Description
This Lora Adapter has been specifically fine-tuned to understand and generate text in Galician. It was refined using a modified version of the irlab-udc/alpaca_data_galician dataset, enriched with synthetic data to enhance its text generation and comprehension capabilities in specific contexts.
Fine-Tuning Objective: To improve text comprehension and generation in Galician.
Trainning parameters
The project is still in the testing phase, and the training parameters will continue to vary to find the values that result in a more accurate model. Currently, the model is trained with a set of 5000 random entries from the dataset and the following values:
num_train_epochs=3.0
finetuning_type="lora"
per_device_train_batch_size=2
gradient_accumulation_steps=4
lr_scheduler_type="cosine"
learning_rate=5e-5
max_grad_norm=1.0
Testing The Adapter
Below, we have several examples of question-answer pairs comparing the pure Llama3 model with the Llama3 model fine tunned for the Galician language.
Llama3-8B 👎
bash
1User: Cal é a capital de Canadá?
2Assistant: Não! Cal não é a capital de Canadá. A capital de Canadá é Ottawa.
Llama3-8B-Galician-Chat-Lora ✅ 👍
bash
1User: Cal é a capital de Canadá?
2Assistant: A capital de Canadá é Ottawa.
Llama3-8B 👎
bash
1User: Cantos habitantes ten Galicia?
2Assistant: Según el Instituto Nacional de Estadística (INE) de España, la población residente en Galicia al 1 de enero de 2021 era de aproximadamente 2.79 millones de personas.
Llama3-8B-Galician-Chat-Lora ✅ 👍
bash
1User: Cantos habitantes ten Galicia?
2Assistant: Segundo as últimas estimacións, Galicia ten uns 2,8 millóns de habitantes.
How to Use the Adapter
To use this adapter, follow the example code provided below. Ensure you have the necessary libraries installed (e.g., Hugging Face's transformers).