A Flask Web App for Generating Text with GPT-2
GPT-2, a very large language model hyped as too dangerous to release its full version, can generate realistic text close to human level based on its input. The authors decided to release only a "less capable" (117M parameter) version.
Set the controversy aside, let's take a look around and see what the smaller model can do with this app. Submitted an initial text, the app will continue the story, and hopefully, take you on a wild ride. Buckle Up. :P
This is a snapshoot of the app currently deployed on a Docker container hosted on my personal development Ubuntu server on DigitalOcean with limited resources. You can setup and run one wherever Docker is enabled. Also, make sure you do not use the development server in a production environment.
-
Clone the repository.
$ git clone [email protected]:jingw222/gpt2-app.git
-
Build a new Docker image from
Dockerfile
.$ cd gpt2-app $ docker build -t gpt2-app:0.1-py3 --rm .
-
Run the app in a container.
$ docker run -p 5000:5000 --name gpt2-app gpt2-app:0.1-py3
-
Navigate to the page where the app is hosted. (e.g.
127.0.0.1:5000
for local deployment, orip:5000
for remote servers)
I may integrate it with some public APIs, like Reddit and Twitter, and do some fun staff.