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
9af845af
Unverified
Commit
9af845af
authored
Apr 14, 2023
by
Joao Gante
Committed by
GitHub
Apr 14, 2023
Browse files
Generate: pin number of beams in BART test (#22763)
parent
66b15efb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/models/bart/test_modeling_bart.py
tests/models/bart/test_modeling_bart.py
+1
-1
No files found.
tests/models/bart/test_modeling_bart.py
View file @
9af845af
...
@@ -1230,7 +1230,7 @@ class BartModelIntegrationTests(unittest.TestCase):
...
@@ -1230,7 +1230,7 @@ class BartModelIntegrationTests(unittest.TestCase):
article
,
add_special_tokens
=
False
,
truncation
=
True
,
max_length
=
512
,
return_tensors
=
"pt"
article
,
add_special_tokens
=
False
,
truncation
=
True
,
max_length
=
512
,
return_tensors
=
"pt"
).
input_ids
.
to
(
torch_device
)
).
input_ids
.
to
(
torch_device
)
outputs
=
bart_model
.
generate
(
input_ids
,
penalty_alpha
=
0.5
,
top_k
=
5
,
max_length
=
64
)
outputs
=
bart_model
.
generate
(
input_ids
,
penalty_alpha
=
0.5
,
top_k
=
5
,
max_length
=
64
,
num_beams
=
1
)
generated_text
=
bart_tokenizer
.
batch_decode
(
outputs
,
skip_special_tokens
=
True
)
generated_text
=
bart_tokenizer
.
batch_decode
(
outputs
,
skip_special_tokens
=
True
)
self
.
assertListEqual
(
self
.
assertListEqual
(
...
...
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