From c108d0b5a43fee12e1ef578fe871f0f123b06018 Mon Sep 17 00:00:00 2001 From: Navjot Date: Mon, 7 Dec 2020 15:35:39 -0800 Subject: [PATCH] add max_length to showcase the use of truncation (#8975) --- docs/source/quicktour.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/quicktour.rst b/docs/source/quicktour.rst index 9d1444e2d..9a42c0f74 100644 --- a/docs/source/quicktour.rst +++ b/docs/source/quicktour.rst @@ -182,6 +182,7 @@ and get tensors back. You can specify all of that to the tokenizer: ... ["We are very happy to show you the 🤗 Transformers library.", "We hope you don't hate it."], ... padding=True, ... truncation=True, + ... max_length=512, ... return_tensors="pt" ... ) >>> ## TENSORFLOW CODE @@ -189,6 +190,7 @@ and get tensors back. You can specify all of that to the tokenizer: ... ["We are very happy to show you the 🤗 Transformers library.", "We hope you don't hate it."], ... padding=True, ... truncation=True, + ... max_length=512, ... return_tensors="tf" ... )