Skip to content

suthidesilva/Finetuning-Microsoft-s-Phi-2-using-QLoRA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Phi-2 Fine-tuning with QLoRA

Overview

This repository contains code and instructions for fine-tuning Microsoft's Phi-2 language model using the PEFT (Pseudo-Elastic Flow Transformer) library, with a focus on Quality Language Representation Adaptation (QLoRA). The QLoRA adaptation is performed to enhance the model's understanding of meaning representations in natural language.

Table of Contents

Background

The Phi-2 model is a powerful language model developed by Microsoft, and this repository demonstrates how to fine-tune it for specific tasks using the PEFT library. QLoRA is employed to adapt the model to generate more accurate and contextually relevant meaning representations.

Getting Started

Follow these steps to get started with the fine-tuning process:

  1. Clone this repository to your local machine.
  2. Install the required dependencies mentioned in requirements.txt.
  3. Set up the training data and adjust parameters in the provided Jupyter notebook (phi2_finetune.ipynb).

Training

The training process involves configuring the model, setting hyperparameters, and monitoring convergence. Key steps include:

  • Defining the base model (Phi-2) and QLoRA adapter.
  • Configuring the training parameters, such as learning rate, batch size, and max steps.
  • Monitoring convergence and adjusting training duration based on performance.

Refer to the phi2_finetune.ipynb notebook for detailed instructions and code snippets.

Evaluation

After training, evaluate the model's performance using specific prompts or input sentences. The provided notebook includes an example of evaluating the fine-tuned model on a target sentence and examining the generated meaning representation.

Results

The results section provides insights into the performance of the fine-tuned Phi-2 model. It includes examples of generated meaning representations and discusses the impact of different training durations.

Contributing

Contributions to this repository are welcome. If you find issues or improvements, please open a GitHub issue or submit a pull request.

License

This project is licensed under the MIT License.


Feel free to customize the README according to your specific details, and ensure that you include the appropriate license file and credit to the original authors or libraries used in the fine-tuning process.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages