Skip to content

Commit f4cd80f

Browse files
authored
Retrieve sliding_window from text config in Gemma3 MM (vllm-project#25085)
Signed-off-by: Harry Mellor <[email protected]>
1 parent 349e0e3 commit f4cd80f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

vllm/model_executor/models/gemma3_mm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,8 @@ def prepare_attn_masks(
688688
global_attn_mask = torch.where(img_mask == 2, 0, global_attn_mask)
689689
global_attn_masks.append(global_attn_mask)
690690

691-
if (sliding_window := self.config.sliding_window) is not None:
691+
sliding_window = self.config.text_config.sliding_window
692+
if sliding_window is not None:
692693
# Create a local causal mask with sliding window (1024).
693694
local_attn_mask = torch.ones_like(global_attn_mask)
694695
local_attn_mask = torch.tril(local_attn_mask,

vllm/model_executor/models/gemma3n_mm.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,6 @@ def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
461461
self.multimodal_config = multimodal_config
462462
self.vocab_size = config.text_config.vocab_size
463463

464-
self.sliding_window = getattr(config.text_config,
465-
"interleaved_sliding_window", None)
466-
467464
self.vision_tower = AutoModel.from_config(config=config.vision_config)
468465
self.audio_tower = AutoModel.from_config(config=config.audio_config)
469466
self.embed_vision = Gemma3nMultimodalEmbedder(config.vision_config,

0 commit comments

Comments
 (0)