Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

naripok/transformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conversational Transformer Models Collection

This repository contains a collection of Conversational Transformer models. It uses tensorflow and stanford's convokit for data fetching and preprocessing.

Installation

  • On a python 3.7+ virtual environment: pip install -r requirements.txt

Training and Running

After installing the package, you can run the training with the commands:

python -m src.biconditional.train --new --train-model --train-tokenizer
python -m src.vanilla.train --new --train-model --train-tokenizer

If on colab environment, you can leverage the TPU cluster for distributed training. Install the packages:

!pip install convokit
!python3 -m spacy download en
!pip install git+https://github.com/naripok/transformer.git@release-0.0.5

Then, activate the TPU environment on the notebook settings and set IS_COLAB env var to True before running the trainin stript, like so:

!export IS_COLAB=True && python -m src.biconditional.train --new --train-model --train-tokenizer
!export IS_COLAB=True && python -m src.vanilla.train --new --train-model --train-tokenizer

Interacting with the models

After training, you can interact with the models on a interactive question-answer session with the commands:

python -m src.biconditional.interact
python -m src.vanilla.interact

Reference