Unverified Commit c108d0b5 authored by Navjot's avatar Navjot Committed by GitHub
Browse files

add max_length to showcase the use of truncation (#8975)

parent 62d30e05
......@@ -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"
... )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment