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):
attention_mask is not None
and hasattr(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
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