Skip to content
Demonstration of gpt-2 model with flask+uwsgi+nginx in web environment containerized in docker for quick deployment.
Python HTML Shell Dockerfile
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
screenshots
src
.gitignore
Dockerfile
README.md
docker-compose.yml
download_model.sh
download_model_windows.sh
flask-site-nginx.conf
gpt2-samples.txt
index.html
nginx.conf
nginx_backup.conf
requirements.txt
supervisord.conf
supervisord.log
uwsgi.ini

README.md

gpt-2-demo

Refactored and Abstracted the GPT-2 model code while putting it beside a flask API and dockerized for easy deployment.

Code and samples from the paper "Language Models are Unsupervised Multitask Learners".

See more details in blog post.

Installation

Download the model data (needs gsutil):

  • Download the model (Linux): sh download_model.sh 117M
  • Download the model (Windows - Bash): sh download_model_windows.sh 117M

In case it fails to download the models/117M/checkpoint file, just create checkpoint file at models/117M/ and add these lines:

model_checkpoint_path: "model.ckpt"
all_model_checkpoint_paths: "model.ckpt"

Build the docker image:

docker-compose build

Start the services

docker-compose up

visit the external IP/localhost to see the live demo.

You can’t perform that action at this time.