This project uses a pre-trained GPT2 model, which was fine-tuned on Rick and Morty transcripts, to generate new stories in the form of a dialog. The project uses Hugging Face's Transformers library to do inference and Streamlit for the application.
Try out the demo to generate fun stories or read the blog post on how to create your own story generator.
You can fine-tune your own model using Google Colab
This repository has only been tested with Python 3.7.
Install the dependencies in a virtual environment:
conda create -n myAppEnv python=3.7 transformers
conda activate myAppEnv
conda install -c huggingface transformers
pip install --upgrade pip setuptools
pip install -r requirements.txt
transformers @ git+git://github.com/huggingface/transformers@59b5953d89544a66d73
On the first run, the app will download the pre-trained model from Hugging Face's Model Hub or you can supply your own custom model in the load_model()
function. To start the application, simply run:
streamlit run app.py