diff --git a/python/pyproject.toml b/python/pyproject.toml index b509618bb..5fdc43b4c 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -43,7 +43,8 @@ runtime_common = [ "soundfile==0.13.1", "scipy", "torchao==0.9.0", - "transformers==4.52.3", + "transformers==4.53.0", + "timm==1.0.16", "uvicorn", "uvloop", "xgrammar==0.1.19", @@ -105,7 +106,6 @@ test = [ "matplotlib", "pandas", "peft", - "timm", "sentence_transformers", ] all = ["sglang[srt]", "sglang[openai]", "sglang[anthropic]", "sglang[litellm]", "sglang[torch_memory_saver]", "sglang[decord]"] diff --git a/python/sglang/srt/models/gemma3_causal.py b/python/sglang/srt/models/gemma3_causal.py index e16c5e2db..f5bff8fc4 100644 --- a/python/sglang/srt/models/gemma3_causal.py +++ b/python/sglang/srt/models/gemma3_causal.py @@ -166,8 +166,7 @@ class Gemma3Attention(nn.Module): prefix=add_prefix("o_proj", prefix), ) - # Determine if layer uses sliding window based on pattern - self.is_sliding = bool((layer_id + 1) % config.sliding_window_pattern) + self.is_sliding = config.layer_types[layer_id] == "sliding_attention" # Initialize the rotary embedding. if self.is_sliding: