A bot trained on local GPT data with the possibility of further expansion of functionality (status: MVP)
Go to file
2023-04-25 14:42:09 +09:00
chadgpt Create: dockerized app 2023-04-24 23:17:01 +09:00
tests Init: poetry project and mvp chadGPT app 2023-04-24 13:54:59 +09:00
.dockerignore Create: dockerized app 2023-04-24 23:17:01 +09:00
.gitignore Create: dockerized app 2023-04-24 23:17:01 +09:00
docker-compose.yml Create: dockerized app 2023-04-24 23:17:01 +09:00
Dockerfile Create: dockerized app 2023-04-24 23:17:01 +09:00
poetry.lock Create: dockerized app 2023-04-24 23:17:01 +09:00
pyproject.toml Create: dockerized app 2023-04-24 23:17:01 +09:00
README.md Create: README.md 2023-04-25 14:42:09 +09:00

chadGPT (status: MVP)

A bot trained on local GPT data with the possibility of further expansion of functionality

Train:

Dependents:

  • python 3.11
  • poetry 1.4.2
git clone https://git.isptech.ru/ISPsystem/chadgpt.git chadgpt
poetry install
poetry shell

To train the bot, you need to place the files in the project's db directory. The file must contain text to be indexed. Additionally *.pdf format is supported

Training requires setting two environment variables:

  • OPENAI_API_KEY (chatGTP key)
  • DB_PATH (full path to the db directory on your local machine)

At the root of the project, you can simply create an .env file and put variables in it in the format key=value

Start train command:

poetry run learn

Use and deploy:

The index file is ignored by git, you must either train the bot first or upload your index.json file to the db directory in the project root

!!! Since it's just an MVP right now, I didn't do any checks to see if the index file was present, so the bot would just crash!!!

To run the bot locally, simply pass the command to poetry:

poetry run chadgpt

This will launch the web interface http://0.0.0.0:7860

Docker app:

The application is dockerized, all you need to run in docker is to set the API key.

The docker-compose.yaml file is present in the project.

version: '3'
services:
 chadgpt:
   container_name: chadgpt
   restart: unless-stopped
   build: ./
   ports:
     - "7860:7860"
   volumes:
     - "./db:/app/db"
   environment:
     - "OPENAI_API_KEY=don't foget replace"

Run:

docker-compose up -d

Restart:

docker-compose up -d --force-recreate

Down:

docker-compose down

Contributing:

The project needs contributors, in its current state it just serves as a demonstration of how easy it is to train GPT on your data. It is necessary to revise the ability to answer in the dialogue mode, form the format of the input data for training, implement interfaces for interacting with the bot through other services, and much more.