anuliketat / llm-chatbot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GPT-3 Fine-Tuned Chatbot

This repository contains code and examples for a GPT-3 based fine-tuned chatbot. The repository includes scripts for fine-tuning the model, a Jupyter notebook demonstrating the chatbot, and necessary datasets.

Repository Structure

  • README.md: This file. Contains an overview of the project and usage instructions.
  • requirements.txt: Python dependencies required for running the code.
  • .gitignore: Specifies files and directories to be ignored by git.
  • LICENSE: License file for the project.
  • notebooks/: Contains Jupyter notebooks.
    • chatbot_demo.ipynb: Jupyter notebook demonstrating the chatbot.
  • scripts/: Contains Python scripts.
    • fine_tune_model.py: Script for fine-tuning the GPT-3 model.
  • data/: Contains dataset files.
    • train.jsonl: Training data used for fine-tuning the model.

Installation

  1. Clone the repository:

    git clone https://github.com/anuliketat/llm-chatbot.git
    cd llm-chatbot
  2. Create a virtual environment:

python3 -m venv venv
source venv/bin/activate
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Fine-Tuning the Model To fine-tune the GPT-3 model, use the llm_finetuned.py script:

Make sure you have your OpenAI API key set as an environment variable:

export OPENAI_API_KEY='your-api-key'

Run the fine-tuning script:

python scripts/fine_tune_model.py

This will fine-tune the GPT-3 model using the dataset provided in data/training_data.jsonl.

Using the Chatbot

To interact with the chatbot, open the notebooks/Chatbot_Example.ipynb Jupyter notebook and follow the instructions inside.

Start Jupyter Notebook:

jupyter notebook

Open Chatbot_Example.ipynb and run the cells to interact with the chatbot.

About

License:Apache License 2.0


Languages

Language:Jupyter Notebook 56.4%Language:Python 43.6%