Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/e-tornike/Story_Generator
A Streamlit web app that generates Rick and Morty stories using GPT2.
https://github.com/e-tornike/Story_Generator
gpt2 huggingface-transformers machine-learning natural-language-processing streamlit
Last synced: about 2 months ago
JSON representation
A Streamlit web app that generates Rick and Morty stories using GPT2.
- Host: GitHub
- URL: https://github.com/e-tornike/Story_Generator
- Owner: e-tornike
- License: mit
- Archived: true
- Created: 2020-10-26T20:53:41.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-20T10:11:58.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T13:33:02.460Z (2 months ago)
- Topics: gpt2, huggingface-transformers, machine-learning, natural-language-processing, streamlit
- Language: Python
- Homepage: https://share.streamlit.io/e-tony/story_generator/main/app.py
- Size: 296 KB
- Stars: 40
- Watchers: 1
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Rick and Morty Story Generator
[![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://share.streamlit.io/e-tony/story_generator/main/app.py)This project uses a [pre-trained GPT2 model](https://huggingface.co/gpt2), which was fine-tuned on [Rick and Morty transcripts](https://rickandmorty.fandom.com/wiki/Category:Transcripts), to generate new stories in the form of a dialog. The project uses Hugging Face's [Transformers library](https://github.com/huggingface/transformers) to do inference and [Streamlit](https://www.streamlit.io/) for the application.
Try out the [demo](https://share.streamlit.io/e-tony/story_generator/main/app.py) to generate fun stories or read the blog [post](https://towardsdatascience.com/rick-and-morty-story-generation-with-gpt2-using-transformers-and-streamlit-in-57-lines-of-code-8f81a8f92692) on how to create your own story generator.
### Fine-tuning a custom model
You can fine-tune your own model using Google Colab [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1opXtwhZ02DjdyoVlafiF3Niec4GqPJvC?usp=sharing)
### Setup
This repository has only been tested with Python 3.7.
Install the dependencies in a virtual environment:
```
python3.7 -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools
pip install -r requirements.txt
```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
```