Skip to content

Chat-bot dedicated to mock behaviour of a real person

Notifications You must be signed in to change notification settings

iolkhovsky/BasilAI

Repository files navigation

Telegram Bot BasilAI

Install

  • prod environment

    make install-prod
  • dev environment

    make install-dev

Generate dataset

make dataset RAW_DATA=<path to telegram dialogs dump json> TARGET=<user_id> DATASET=<path to csv file to save generated dataset>

Generate advanced dataset

make dataset_advanced \
  USER_ID=<user id> \
  RAW_DATASET=<path to raw json dialog file> \
  DIALOG_SECONDS_COOLDOWN=<minimum time distance in seconds between different dialogs> \
  DIALOG_MEMORY=<message number in memory to answer> \
  DAATSET_OUTPUT=<path to save generated dataset folder>

Fit tokenizer

make fit_tokenizer \
  TOKENIZER_DATASET=<path to the dataset> \
  TOKENIZER=<tokenizer class> \
  TOKENIZER_SIZE=<tokenizer vocab size> \
  TOKENIZER_OUTPUT=<path to save tokenizer>

Train model

make train TRAIN_CONFIG=<path to config file>

Run telegram bot locally

make bot TOKEN=<telegram bot auth token>

Heroku hosting

Getting started with heroku

  • authenticate on heroku

    heroku login
  • add git heroku remote

    heroku git:remote -a basilai-bot

Pushing new version to heroku

  • push local master branch to heroku main branch

    git push heroku master:main

    you can push any local branch - just change master to branch name

  • heroku restarts application with new version automatically

Scaling heroku application

  • check heroku running apps

    heroku ps
  • scale heroku apps

    heroku ps:scale worker=1
  • stop heroku apps

    heroku ps:stop worker.1

Get logs

heroku logs -t

About

Chat-bot dedicated to mock behaviour of a real person

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published