Skip to content

This repo contains a tutorial for a finetune of mistralai/mistral-7b-v0.1. More information can be found in their paper: https://huggingface.co/papers/2310.06825

License

Notifications You must be signed in to change notification settings

tdolan21/marlin-mistral-7b-v0.1-ft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marlin-Mistral-7b-v0.1 FT Guide

Python Jupyter PyTorch Transformers Datasets Accelerate WandB HuggingFace Hub

Introduction

This repository contains a Jupyter notebook that serves as a follow along guide for my blog post surrounding this finetune.

Instructions

This tutorial is around 80% modular for many models available on huggingface. If you prepare your own data, clean it, and fit it into this structure you should be able to train other models as well.

Setting Up

  1. Clone this repository to your local machine.
  2. Create a virtual environment (optional but recommended).
  3. Install the required libraries using the command pip install -r requirements.txt.

Running the Jupyter Notebook

  1. Navigate to the cloned repository.
  2. Launch Jupyter Notebook by running jupyter notebook.
  3. Open the marlin-mistral-ft.ipynb notebook.
  4. Execute the cells in the notebook to run the code.

Training Code (training.py)

The training script, training.py, covers the following steps:

  1. Setting up the accelerator.
  2. Loading and processing the training dataset.
  3. Loading the base model and tokenizer.
  4. Tokenizing and formatting the dataset.
  5. Checking and evaluating the base model.
  6. Fine-tuning the model using the Peft approach.
  7. Training the model using the Transformers library.
  8. Evaluating the fine-tuned model.
  9. Pushing the model to the HuggingFace Hub.

To run the training script:

python training.py

The current setup for this script will evaluate the original model and the finetuned model based on the loaded dataset.

Acknowledgements

mistralai/mistral-7b-v0.1 Paper

About

This repo contains a tutorial for a finetune of mistralai/mistral-7b-v0.1. More information can be found in their paper: https://huggingface.co/papers/2310.06825

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published