Skip to content

Instantly share code, notes, and snippets.

@YiLi225
Last active May 5, 2022 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YiLi225/4bbd58f0b0231fc909becd6050b211c1 to your computer and use it in GitHub Desktop.
Save YiLi225/4bbd58f0b0231fc909becd6050b211c1 to your computer and use it in GitHub Desktop.
# Install: !pip install next_word_prediction
# curText = doc_set[1135957]
from next_word_prediction import GPT2
gpt2 = GPT2()
# Predict the next word after 'vegetarian'
gpt2.predict_next(curText.replace('[MASK]', ''), 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment