GPT-2 Example usage

October 27, 2020 ยท View on GitHub

Setup

cd examples/gpt-2

# Install gpt-2 dependencies
pip3 install --upgrade regex 

# Clone the OpenAI GPT-2 repository
git clone https://github.com/openai/gpt-2.git

# Download model weights
cd gpt-2
python3 download_model.py 124M
cd ..

Running

python3 gpt2.py

You should see something like this:

The definition of unicorn is a creature that is a unicorn, but not a

All Together Now (all together now!)

The definition of unicorn is a creature that is a unicorn, but not a