attention mask
This commit is contained in:
parent
6c7f0dbcb4
commit
166f8c812e
2 changed files with 2 additions and 2 deletions
|
|
@ -489,7 +489,7 @@ def LlamaModel_fast_forward(
|
||||||
# Ignore attention_mask
|
# Ignore attention_mask
|
||||||
if attention_mask is None:
|
if attention_mask is None:
|
||||||
padding_mask = None
|
padding_mask = None
|
||||||
elif False:#self.training:
|
elif self.training:
|
||||||
attention_mask = None
|
attention_mask = None
|
||||||
padding_mask = None
|
padding_mask = None
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ def MistralAttention_fast_forward(
|
||||||
past_key_value = (K, V) if use_cache else None
|
past_key_value = (K, V) if use_cache else None
|
||||||
|
|
||||||
# Attention module
|
# Attention module
|
||||||
if (attention_mask is None and not HAS_FLASH_ATTENTION):
|
if (not HAS_FLASH_ATTENTION):
|
||||||
# Xformers memory efficient attention
|
# Xformers memory efficient attention
|
||||||
Q = Q.transpose(1, 2)
|
Q = Q.transpose(1, 2)
|
||||||
K = K.transpose(1, 2)
|
K = K.transpose(1, 2)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue