Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<<<<<<< HEAD

GPT-2 Fine-tuning on ConvoAI Dataset

Description

This repository contains code for fine-tuning a GPT-2 LM head model from Hugging Face on the ConvoAI dataset. The project includes both a Google Colab notebook and Python scripts for local execution.

Contents

  • Google Colab notebook for cloud-based execution
  • Python scripts for local execution
  • Requirements and setup instructions for both environments

Prerequisites

  • Python 3.7+
  • PyTorch
  • Transformers library from Hugging Face
  • ConvoAI dataset (instructions for downloading included in the code)

Installation and Setup

Local PC Setup

  1. Clone this repository:
    git clone https://github.com/DivyanshTiwari20/fine-tunning-GPT2LMHeadModel.git
    
  2. Install the required packages:
    pip install torch transformers datasets numpy pandas tqdm
    

Google Colab Setup

  1. Open the provided .ipynb file in Google Colab.
  2. Run the following cell to install necessary packages:
    !pip install torch
    !pip install transformers
    !pip install datasets
    !pip install numpy
    !pip install pandas
    !pip install tqdm

Usage

Local PC

  1. Navigate to the project directory.
  2. Run the main Python script:
    python fine_tune_gpt2.py
    

Google Colab

  1. Open the notebook in Google Colab.
  2. Follow the step-by-step instructions in the notebook.
  3. Run each cell sequentially.

Important Packages

Make sure you have the following packages installed:

  • torch
  • transformers
  • datasets
  • numpy
  • pandas
  • tqdm

To install these packages, you can use the following commands:

pip install torch
pip install transformers
pip install datasets
pip install numpy
pip install pandas
pip install tqdm

These packages are crucial for running the fine-tuning process, whether on a local PC or Google Colab.

Tutorial

For a detailed walkthrough of the fine-tuning process, check out this YouTube tutorial: Fine-tuning GPT-2 on Custom Dataset

Model Details

  • Base Model: GPT-2 LM head from Hugging Face
  • Dataset: ConvoAI
  • Fine-tuning Process: The model is fine-tuned on conversational data to improve its performance in dialogue generation tasks.

Results

(Add information about the performance of your fine-tuned model, any benchmarks, or sample outputs)

Contributing

Contributions to improve the fine-tuning process or extend the project are welcome. Please feel free to submit issues or pull requests.

Acknowledgements

  • Hugging Face for providing the GPT-2 model and Transformers library
  • ConvoAI for the dataset
  • The creators of the YouTube tutorial for their helpful guide =======

finetuned-gpt2-convai

This repo is about finetuning gpt2 model provided by Transformers. I fine tuned the model in convai dataset.

1d83f9c837db2d550e827c246fcc172aa4115f0c

About

Fine tunning GPT2LMHeadModel from hugging face

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages