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
0b568291
Unverified
Commit
0b568291
authored
Aug 16, 2023
by
Joao Gante
Committed by
GitHub
Aug 16, 2023
Browse files
Marian: post-hack-fix correction (#25459)
parent
5ccf343a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
tests/models/marian/test_modeling_marian.py
tests/models/marian/test_modeling_marian.py
+5
-1
No files found.
tests/models/marian/test_modeling_marian.py
View file @
0b568291
...
...
@@ -438,7 +438,11 @@ class MarianIntegrationTest(unittest.TestCase):
)
self
.
assertEqual
(
self
.
model
.
device
,
model_inputs
.
input_ids
.
device
)
generated_ids
=
self
.
model
.
generate
(
model_inputs
.
input_ids
,
attention_mask
=
model_inputs
.
attention_mask
,
num_beams
=
2
,
max_length
=
128
model_inputs
.
input_ids
,
attention_mask
=
model_inputs
.
attention_mask
,
num_beams
=
2
,
max_length
=
128
,
renormalize_logits
=
True
,
# Marian should always renormalize its logits. See #25459
)
generated_words
=
self
.
tokenizer
.
batch_decode
(
generated_ids
,
skip_special_tokens
=
True
)
return
generated_words
...
...
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