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
a637ae00
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "2150dfed313213037e16288498d7dc2d59947560"
Unverified
Commit
a637ae00
authored
Mar 11, 2021
by
Lysandre Debut
Committed by
GitHub
Mar 11, 2021
Browse files
Fixes Pegasus tokenization tests (#10671)
parent
7e442874
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/test_modeling_tf_pegasus.py
tests/test_modeling_tf_pegasus.py
+1
-1
No files found.
tests/test_modeling_tf_pegasus.py
View file @
a637ae00
...
@@ -356,7 +356,7 @@ class TFPegasusIntegrationTests(unittest.TestCase):
...
@@ -356,7 +356,7 @@ class TFPegasusIntegrationTests(unittest.TestCase):
assert
self
.
expected_text
==
generated_words
assert
self
.
expected_text
==
generated_words
def
translate_src_text
(
self
,
**
tokenizer_kwargs
):
def
translate_src_text
(
self
,
**
tokenizer_kwargs
):
model_inputs
=
self
.
tokenizer
(
self
.
src_text
,
**
tokenizer_kwargs
,
return_tensors
=
"tf"
)
model_inputs
=
self
.
tokenizer
(
self
.
src_text
,
**
tokenizer_kwargs
,
padding
=
True
,
return_tensors
=
"tf"
)
generated_ids
=
self
.
model
.
generate
(
generated_ids
=
self
.
model
.
generate
(
model_inputs
.
input_ids
,
model_inputs
.
input_ids
,
attention_mask
=
model_inputs
.
attention_mask
,
attention_mask
=
model_inputs
.
attention_mask
,
...
...
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