ruDialoGPT icon indicating copy to clipboard operation
ruDialoGPT copied to clipboard

Training a Russian DialoGPT model.

A Russian DialoGPT model

This is a fork of the DialoGPT repository. With code and pretrained dialogue response generation model for russian language.

Used repositories

  • The toketisator is from the YouTokenToMe repository.
  • The model architecture is trom HuggingFace.
  • The fp16 realisation is from the Megatron-LM repository.
  • Pretrained GPT-2 model is from the ruGPT2 repository.

Training the model

Input dataset must be in the DialoGPT tsv format:

0.0 Вот, держите. EOS А на чай? EOS Никакого чая. я ученый, а не банкир.	1.0 Ага, не банкир. живет во дворце и денег нет, так я и поверил.
0.0 Я собиралась спросить тебя то же самое.	1.0 Я получил записку от сэра Гарри, в которой он просит меня подойти к окну.
0.0 Не смущайся! Об него всегда все ударяются. Вечно он стоит где не надо!	1.0 Зачем - Джаф - тебе - помог?
0.0 Вот, один врачу, другой вам.	1.0 А нам-то за что?

Prepare the train data:

./scripts/preprocess.sh

Download a GPT-2 model from ruGPT2. And convert it with the convert_megatron_to_dialogpt.py script:

./scripts/convert.sh

Train the model:

./scripts/train.sh

Download pretrained model

There is a model trained for 6 days on 2x1080Ti GPU. Model trained on the russian books dialogues for 300K steps with batch size 64.

300K books dialogues model

Run dialogue interaction

There is the script to start the interaction:

./script/interact.sh

Run a telegram bot

A telegram bot is based on code from gpt2bot repository.

Add your telegram bot token to the script and run:

./script/run_bot.sh