/docker-gpt2

A Dockerized version of OpenAIs gpt2 language model.

Primary LanguagePython

Dockerized gpt-2

Dockerized version of the GPT-2 Language model by Open AI.

docker build -t openai-nlp . 
docker run --rm -i -t openai-nlp

README from original repo

Github Link

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

For now, we have only released a smaller (117M parameter) version of GPT-2.

See more details in our blog post.

Unconditional sample generation

WARNING: Samples are unfiltered and may contain offensive content.

To generate unconditional samples from the small model:

python3 src/generate_unconditional_samples.py | tee samples

There are various flags for controlling the samples:

python3 src/generate_unconditional_samples.py --top_k 40 --temperature 0.7 | tee samples

Conditional sample generation

To give the model custom prompts, you can use:

python3 src/interactive_conditional_samples.py --top_k 40