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 and itazap committed Jul 25, 2024
1 parent 46e0353 commit 7e1468c
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 7e1468c

Please sign in to comment.