Unverified Commit e4682de6 authored by Joao Gante's avatar Joao Gante Committed by GitHub
Browse files

Masking: remove flakiness from test (#31939)

parent a1a34657
...@@ -1571,9 +1571,6 @@ class WhisperModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMi ...@@ -1571,9 +1571,6 @@ class WhisperModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMi
out_last_tokens = logits[:, -1, :] # last tokens in each batch line out_last_tokens = logits[:, -1, :] # last tokens in each batch line
out_shared_prefix_last_tokens = logits_shared_prefix[0, -3:, :] # last three tokens 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: # comparing softmax-normalized logits:
normalized_0 = torch.nn.functional.softmax(out_last_tokens) normalized_0 = torch.nn.functional.softmax(out_last_tokens)
normalized_1 = torch.nn.functional.softmax(out_shared_prefix_last_tokens) normalized_1 = torch.nn.functional.softmax(out_shared_prefix_last_tokens)
......
...@@ -4486,9 +4486,6 @@ class ModelTesterMixin: ...@@ -4486,9 +4486,6 @@ class ModelTesterMixin:
out_last_tokens = logits[:, -1, :] # last tokens in each batch line out_last_tokens = logits[:, -1, :] # last tokens in each batch line
out_shared_prefix_last_tokens = logits_shared_prefix[0, -3:, :] # last three tokens 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: # comparing softmax-normalized logits:
normalized_0 = F.softmax(out_last_tokens) normalized_0 = F.softmax(out_last_tokens)
normalized_1 = F.softmax(out_shared_prefix_last_tokens) normalized_1 = F.softmax(out_shared_prefix_last_tokens)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment