Skip to content

Instantly share code, notes, and snippets.

@caleb-kaiser
Last active November 8, 2019 21:03
Show Gist options
  • Save caleb-kaiser/ac26dfbcbcc67b4c5581415087118bda to your computer and use it in GitHub Desktop.
Save caleb-kaiser/ac26dfbcbcc67b4c5581415087118bda to your computer and use it in GitHub Desktop.
# predictor.py
from transformers import GPT2Tokenizer, GPT2LMHeadModel
# download the pretrained DistilGPT2 model and set it to evaluation
model = GPT2LMHeadModel.from_pretrained("distilgpt2")
model.eval()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment