/gpt2-app

A Flask Web App for Generating Text with GPT-2

Primary LanguagePythonMIT LicenseMIT

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

Demo

Demo

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.

Usage

  1. Clone the repository.

    $ git clone git@github.com:jingw222/gpt2-app.git
    
  2. Build a new Docker image from Dockerfile.

    $ cd gpt2-app
    $ docker build -t gpt2-app:0.1-py3 --rm .
    
  3. Run the app in a container.

    $ docker run -p 5000:5000 --name gpt2-app gpt2-app:0.1-py3
    
  4. Navigate to the page where the app is hosted. (e.g. 127.0.0.1:5000 for local deployment, or ip:5000 for remote servers)

Future work

I may integrate it with some public APIs, like Reddit and Twitter, and do some fun staff.

License

MIT