[Cohere] Misc changes to cohere model definitions (#50156)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Komal Kumar Teru
2026-08-18 04:59:57 +00:00
committed by GitHub
co-authored by Cursor
parent 101c4477dd
commit aa9903490c
2 changed files with 87 additions and 26 deletions
+1 -1
View File
@@ -208,7 +208,7 @@ class Cohere2MoeAttention(nn.Module):
layer_types is not None
and layer_types[self.layer_idx] == "sliding_attention"
):
self.sliding_window = config.sliding_window
self.sliding_window = config.sliding_window + 1
# Prefix-dense layers have full attention (no sliding window). When
# prefix_dense_sliding_window_pattern == 1, they keep RoPE even though