Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
16043211
Unverified
Commit
16043211
authored
Oct 30, 2023
by
Younes Belkada
Committed by
GitHub
Oct 30, 2023
Browse files
[`FA2`/ `Mistral`] Revert previous behavior with right padding + forward (#27125)
Update modeling_mistral.py
parent
211ad4c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
src/transformers/models/mistral/modeling_mistral.py
src/transformers/models/mistral/modeling_mistral.py
+1
-0
No files found.
src/transformers/models/mistral/modeling_mistral.py
View file @
16043211
...
...
@@ -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
:
...
...
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