Skip to content

Commit

Permalink
[mistral] Fix FA2 attention reshape for Mistral Nemo (#32065)
Browse files Browse the repository at this point in the history
* [mistral] Fix FA2 attention reshape

* [run-slow] mistral
  • Loading branch information
xenova authored Jul 19, 2024
1 parent cd48553 commit 22f888b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/mistral/modeling_mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def forward(
is_causal=self.is_causal,
)

attn_output = attn_output.reshape(bsz, q_len, self.hidden_size).contiguous()
attn_output = attn_output.reshape(bsz, q_len, self.num_heads * self.head_dim).contiguous()
attn_output = self.o_proj(attn_output)

if not output_attentions:
Expand Down

0 comments on commit 22f888b

Please sign in to comment.