Personal telegram chat-bot based on OpenAI GPT-3 finetuning.
This code from articles:
- https://habr.com/ru/post/712534/ (Transfering our points of view to a chat bot based on GPT-3)
- https://habr.com/ru/post/724012/ (GPT-3 code generation and runtime execution)
- Install requirements
pip install -r requirements.txt
- Get OpenAI API key from your account
- Setup yout OpenAI key
export OPENAI_API_KEY=<YOUR_KEY>
- Fill your dataset with your answers in
dataset.txt
- Validate your dataset
openai tools fine_tunes.prepare_data -f dataset.jsonl -q
- Fine-tune your model and get unique model name
openai api fine_tunes.create -t dataset.jsonl -m davinci --suffix "<YOUR_MODEL_NAME>"
- Create Telegram bot using BotFather
- Update tg_bot.py with your bot token, OpenAI Token and model name.
- Run! For english version:
python tg_bot_eng.py
For russian version:
python tg_bot_rus.py
OPENAI_API_KEY=<YOUR_OPENAI_KEY> TG_TOKEN=<YOUR_TELEGRAM_BOT_TOKEN> tg_bot_with_python.py