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
e4682de6
Unverified
Commit
e4682de6
authored
Jul 15, 2024
by
Joao Gante
Committed by
GitHub
Jul 15, 2024
Browse files
Masking: remove flakiness from test (#31939)
parent
a1a34657
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
6 deletions
+0
-6
tests/models/whisper/test_modeling_whisper.py
tests/models/whisper/test_modeling_whisper.py
+0
-3
tests/test_modeling_common.py
tests/test_modeling_common.py
+0
-3
No files found.
tests/models/whisper/test_modeling_whisper.py
View file @
e4682de6
...
...
@@ -1571,9 +1571,6 @@ class WhisperModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMi
out_last_tokens
=
logits
[:,
-
1
,
:]
# last tokens in each batch line
out_shared_prefix_last_tokens
=
logits_shared_prefix
[
0
,
-
3
:,
:]
# last three tokens
# comparing greedily-chosen tokens:
assert
torch
.
equal
(
out_last_tokens
.
max
(
axis
=
1
).
indices
,
out_shared_prefix_last_tokens
.
max
(
axis
=
1
).
indices
)
# comparing softmax-normalized logits:
normalized_0
=
torch
.
nn
.
functional
.
softmax
(
out_last_tokens
)
normalized_1
=
torch
.
nn
.
functional
.
softmax
(
out_shared_prefix_last_tokens
)
...
...
tests/test_modeling_common.py
View file @
e4682de6
...
...
@@ -4486,9 +4486,6 @@ class ModelTesterMixin:
out_last_tokens
=
logits
[:,
-
1
,
:]
# last tokens in each batch line
out_shared_prefix_last_tokens
=
logits_shared_prefix
[
0
,
-
3
:,
:]
# last three tokens
# comparing greedily-chosen tokens:
assert
torch
.
equal
(
out_last_tokens
.
max
(
axis
=
1
).
indices
,
out_shared_prefix_last_tokens
.
max
(
axis
=
1
).
indices
)
# comparing softmax-normalized logits:
normalized_0
=
F
.
softmax
(
out_last_tokens
)
normalized_1
=
F
.
softmax
(
out_shared_prefix_last_tokens
)
...
...
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