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
2977bd52
Unverified
Commit
2977bd52
authored
Oct 13, 2020
by
Sam Shleifer
Committed by
GitHub
Oct 13, 2020
Browse files
Faster pegasus tokenization test with reduced data size (#7762)
parent
2d6e2ad4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/test_tokenization_pegasus.py
tests/test_tokenization_pegasus.py
+1
-1
No files found.
tests/test_tokenization_pegasus.py
View file @
2977bd52
...
...
@@ -57,7 +57,7 @@ class PegasusTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
@
require_torch
def
test_pegasus_large_seq2seq_truncation
(
self
):
src_texts
=
[
"This is going to be way too long"
*
1
000
0
,
"short example"
]
src_texts
=
[
"This is going to be way too long
.
"
*
1
5
0
,
"short example"
]
tgt_texts
=
[
"not super long but more than 5 tokens"
,
"tiny"
]
batch
=
self
.
pegasus_large_tokenizer
.
prepare_seq2seq_batch
(
src_texts
,
tgt_texts
=
tgt_texts
,
max_target_length
=
5
)
assert
batch
.
input_ids
.
shape
==
(
2
,
1024
)
...
...
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