Update mistral.py
This commit is contained in:
parent
2b346dc498
commit
ab0a3c9976
1 changed files with 1 additions and 1 deletions
|
|
@ -132,7 +132,7 @@ def MistralAttention_fast_forward(
|
|||
Q = Q.transpose(1, 2)
|
||||
K = K.transpose(1, 2)
|
||||
V = V.transpose(1, 2)
|
||||
sw = isinstance(causal_mask, xformers.attn_bias.BlockDiagonalCausalMask)
|
||||
sw = getattr(self.config, "sliding_window", None)
|
||||
sw = kv_seq_len if (sw is None or sw == "null") else sw
|
||||
window = (-1, -1) if (kv_seq_len <= sw) else (sw, sw)
|
||||
A = flash_attn_func(Q, K, V, causal = True, window_size = window)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue