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
b1ba03e0
Commit
b1ba03e0
authored
Feb 09, 2022
by
Sylvain Gugger
Browse files
Fix quality
parent
eed3186b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/test_generation_beam_search.py
tests/test_generation_beam_search.py
+1
-1
No files found.
tests/test_generation_beam_search.py
View file @
b1ba03e0
...
...
@@ -318,7 +318,7 @@ class ConstrainedBeamSearchTester:
beam_hyp
.
add
(
input_ids
[
beam_idx
],
-
10.0
+
float
(
beam_idx
))
# -10.0 is removed => -9.0 is worst score
self
.
parent
.
assertAlmostEqual
(
beam_hyp
.
worst_score
,
-
9.0
/
(
self
.
sequence_length
**
beam_hyp
.
length_penalty
))
self
.
parent
.
assertAlmostEqual
(
beam_hyp
.
worst_score
,
-
9.0
/
(
self
.
sequence_length
**
beam_hyp
.
length_penalty
))
# -5.0 is better than worst score => should not be finished
self
.
parent
.
assertFalse
(
beam_hyp
.
is_done
(
-
5.0
,
self
.
sequence_length
))
...
...
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