From 149c833b75084c8a4816401a1add011abe06eba0 Mon Sep 17 00:00:00 2001 From: SaulLu <55560583+SaulLu@users.noreply.github.com> Date: Mon, 13 Sep 2021 13:32:32 +0200 Subject: [PATCH] Small changes in `perplexity.rst`to make the notebook executable on google collaboratory (#13541) * add imports * Update docs/source/perplexity.rst Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> --- docs/source/perplexity.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/source/perplexity.rst b/docs/source/perplexity.rst index 3e33d376ff..2f7793fda5 100644 --- a/docs/source/perplexity.rst +++ b/docs/source/perplexity.rst @@ -110,6 +110,9 @@ available to condition on). .. code-block:: python + import torch + from tqdm import tqdm + max_length = model.config.n_positions stride = 512