Twin Llama 3.1 8 B D P O
mlabonneIntroduction
The TwinLlama-3.1-8B-DPO is a sophisticated text generation model developed by mlabonne. It is based on the Llama architecture and has been optimized for increased training efficiency using the Unsloth tool and Hugging Face’s TRL library. It supports English and is licensed under the Apache 2.0 License.
Architecture
TwinLlama-3.1-8B-DPO is a transformer-based model focused on text generation tasks. It leverages the capabilities of the Llama architecture to enhance inference and fine-tuning processes. The model was fine-tuned from the base model, mlabonne/TwinLlama-3.1-8B
.
Training
This model underwent a fine-tuning process that was accelerated using the Unsloth platform, achieving twice the usual training speed. The training incorporated Hugging Face's TRL library to optimize performance, ensuring that the model is efficient in generating high-quality text.
Guide: Running Locally
To run TwinLlama-3.1-8B-DPO locally, follow these steps:
-
Install Dependencies: Ensure that you have Python and the Hugging Face Transformers library installed.
pip install transformers
-
Download the Model: Clone the model from its repository.
git clone https://huggingface.co/mlabonne/TwinLlama-3.1-8B-DPO
-
Load the Model: Use the Transformers library to load the model.
from transformers import AutoModelForCausalLM, AutoTokenizer model = AutoModelForCausalLM.from_pretrained("mlabonne/TwinLlama-3.1-8B-DPO") tokenizer = AutoTokenizer.from_pretrained("mlabonne/TwinLlama-3.1-8B-DPO")
-
Run Inference: Input text and generate output.
inputs = tokenizer("Your input text here", return_tensors="pt") outputs = model.generate(**inputs) print(tokenizer.decode(outputs[0]))
Cloud GPUs: For optimal performance, especially with large models, consider using cloud GPU services like AWS, Google Cloud, or Azure.
License
The TwinLlama-3.1-8B-DPO is released under the Apache 2.0 License, allowing for both personal and commercial use with proper attribution.