Skip to content

Commit

Permalink
Respect sliding_window=None (#1214)
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamGenX authored Jan 26, 2024
1 parent 5407ddd commit 62ca4a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/axolotl/monkeypatch/mistral_attn_hijack_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _prepare_decoder_attention_mask(
sliding_window,
): # pylint: disable=unused-argument
# [bsz, seq_len]
if attention_mask is None:
if attention_mask is None or sliding_window is None:
return attention_mask

# NOTE: attention mask and sliding masks are only broadcastable in certain scenarios.
Expand Down Expand Up @@ -151,7 +151,7 @@ def flashattn_forward(
)

use_sliding_windows = (
hasattr(self.config, "sliding_window") is not None
getattr(self.config, "sliding_window") is not None
and kv_seq_len > self.config.sliding_window
)

Expand Down

0 comments on commit 62ca4a2

Please sign in to comment.