This demo is built based on streamlit
.
To run the demo, make sure the repo is on the demo
branch.
git branch
# * demo
# main
Follow steps below in SwitchingLM/demo/
.
The checkpoint can be downloaded here: (Russia | LeftRight) and should be placed under ckpt/
. By default, the Russia checkpoint should be used.
mkdir ckpt
mv <YOUR_DOWNLOADED_CKPT> ckpt
To install dependencies, install pytorch, transformers, and streamlit at the official websites, or simply through package management tools such as pip.
pip install torch
pip install transformers
pip install streamlit
pip install st-annotated-text
pip install nltk
pip install accelerate
pip install graphviz
Prepare the punkt functionality
python -c "import nltk; nltk.download('punkt')"
Once the checkpoint and the dependencies are prepared, run
streamlit run Home.py
Check out our slides for the functionalities!