https://github.com/ankur-krgarg/fine-tuning-language-models-_with_lora_and_sft
Fine-Tuning Language Models with LoRA and SFT
https://github.com/ankur-krgarg/fine-tuning-language-models-_with_lora_and_sft
Last synced: 2 months ago
JSON representation
Fine-Tuning Language Models with LoRA and SFT
- Host: GitHub
- URL: https://github.com/ankur-krgarg/fine-tuning-language-models-_with_lora_and_sft
- Owner: Ankur-krGarg
- License: gpl-3.0
- Created: 2025-01-14T12:27:50.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-14T12:33:10.000Z (9 months ago)
- Last Synced: 2025-01-21T16:19:50.303Z (9 months ago)
- Language: Jupyter Notebook
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fine-Tuning Language Models with LoRA and SFT
Overview:
This repository contains code for fine-tuning the OPT (Open Pre-trained Transformer) language model using Low-Rank Adaptation (LoRA) and Supervised Fine-Tuning (SFT) techniques. The goal is to enhance the model's performance on specific tasks while maintaining efficiency in training.Table of Contents:
- Features
- Requirements
- Getting Started
- Usage
- Results
- Contributing
- LicenseFeatures:
- Fine-tuning of the OPT language model using LoRA for efficient training.
- Utilizes SFT to adapt the model to specific datasets.
- Integration with Weights & Biases (wandb) for experiment tracking.
- Easy-to-follow code structure with clear documentation.Requirements:
To run the code, you will need:
- Python 3.6 or higher
- Google Colab or a local environment with GPU support
- Required libraries:
- transformers
- trl
- deeplake
- wandb
- peftYou can install the required libraries using pip.
Getting Started:
1. Clone the repository.
2. Open the Jupyter Notebook in Google Colab or your local environment.
3. Follow the instructions in the notebook to set up your environment and run the code.Usage:
- Load your dataset into the notebook.
- Use the provided functions to format the data for training.
- Fine-tune the model using the LoRA configuration.
- Evaluate the model's performance on a test dataset.Results:
The fine-tuned model demonstrates improved performance on specific tasks compared to the base model. Metrics such as training loss and validation loss are logged for analysis.