Example: Calculating perplexity with GPT-2 in 🤗 Transformers Let's demonstrate this process with GPT-2.