Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
22f888b3
Unverified
Commit
22f888b3
authored
Jul 19, 2024
by
Joshua Lochner
Committed by
GitHub
Jul 19, 2024
Browse files
[mistral] Fix FA2 attention reshape for Mistral Nemo (#32065)
* [mistral] Fix FA2 attention reshape * [run-slow] mistral
parent
cd48553f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/mistral/modeling_mistral.py
src/transformers/models/mistral/modeling_mistral.py
+1
-1
No files found.
src/transformers/models/mistral/modeling_mistral.py
View file @
22f888b3
...
@@ -387,7 +387,7 @@ class MistralFlashAttention2(MistralAttention):
...
@@ -387,7 +387,7 @@ class MistralFlashAttention2(MistralAttention):
is_causal
=
self
.
is_causal
,
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
)
attn_output
=
self
.
o_proj
(
attn_output
)
if
not
output_attentions
:
if
not
output_attentions
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment