Skip to content

ahwang16/gpt3-chatbot

Repository files navigation

Build Your Own ChatGPT

Welcome to the GPT-3 Chatbot! This is a small web app that queries the OpenAI API to make a chatbot powered by GPT-3. The chatbot also has a persona, which can be chosen on the home page.

A lot of this code (and basically all of the README!) was adapted from the OpenAI Quickstart Tutorial for Python.

Tutorial

I worked on this project as part of my PhD candidacy exam (WPE-II for fellow Penn CIS people). Check out my report (TBA) "Build Your Own ChatGPT" for more a practical overview of GPT-3, design critique, and code walkthrough.

A Slight Bug...

The chatbot supports querying any fine-tuned model that you have on your account, but it supports only text-davinci-002 out of the regular GPT-3 models because of the way the API is set up. Adding the rest is a simple fix that I haven't gotten around to yet!

Setup

  1. If you don’t have Python installed, install it from here

  2. Clone this repository

  3. Navigate into the project directory

$ cd gpt3-chatbot
  1. Create a new virtual environment
$ python -m venv venv
$ . venv/bin/activate
  1. Install the requirements
$ pip install -r requirements.txt
  1. Make a copy of the example environment variables file
$ cp .env.example .env
  1. Add your API key to the newly created .env file

  2. Run the app

$ flask run

You should now be able to access the app at http://localhost:5000!

About

GPT-3 persona chatbot with GUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published