Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
c108d0b5
Unverified
Commit
c108d0b5
authored
Dec 07, 2020
by
Navjot
Committed by
GitHub
Dec 07, 2020
Browse files
add max_length to showcase the use of truncation (#8975)
parent
62d30e05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
docs/source/quicktour.rst
docs/source/quicktour.rst
+2
-0
No files found.
docs/source/quicktour.rst
View file @
c108d0b5
...
...
@@ -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"
...
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment