"tests/t5/test_modeling_tf_t5.py" did not exist on "2e12b907ae73edd2f3590cefdfa5d11f74aabfac"
Unverified Commit 16043211 authored by Younes Belkada's avatar Younes Belkada Committed by GitHub
Browse files

[`FA2`/ `Mistral`] Revert previous behavior with right padding + forward (#27125)

Update modeling_mistral.py
parent 211ad4c9
...@@ -820,6 +820,7 @@ class MistralModel(MistralPreTrainedModel): ...@@ -820,6 +820,7 @@ class MistralModel(MistralPreTrainedModel):
attention_mask is not None attention_mask is not None
and hasattr(self.config, "_flash_attn_2_enabled") and hasattr(self.config, "_flash_attn_2_enabled")
and self.config._flash_attn_2_enabled and self.config._flash_attn_2_enabled
and past_key_values is not None
): ):
is_padding_right = attention_mask[:, -1].sum().item() != batch_size is_padding_right = attention_mask[:, -1].sum().item() != batch_size
if is_padding_right: if is_padding_right:
......
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