Create: README.md
This commit is contained in:
parent
b77a3d76f4
commit
8507a61eb8
85
README.md
85
README.md
@ -0,0 +1,85 @@
|
||||
# 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
|
||||
|
||||
```sh
|
||||
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:
|
||||
```sh
|
||||
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:
|
||||
```sh
|
||||
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.
|
||||
|
||||
```yaml
|
||||
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:
|
||||
```sh
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
Restart:
|
||||
```sh
|
||||
docker-compose up -d --force-recreate
|
||||
```
|
||||
|
||||
Down:
|
||||
```sh
|
||||
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.
|
Loading…
Reference in New Issue
Block a user