Fix gemma3n with hybrid swa (#8240)

Signed-off-by: Xinyuan Tong <xinyuantong.cs@gmail.com>
Co-authored-by: Xinyuan Tong <xinyuantong.cs@gmail.com>
This commit is contained in:
Xinyuan Tong
2025-07-23 13:29:18 -07:00
committed by GitHub
parent 70251e935e
commit 38000a5f44
3 changed files with 28 additions and 3 deletions

View File

@@ -276,6 +276,7 @@ class ModelRunner:
self.sampler = Sampler()
self.load_model()
# Check if the model is using hybrid SWA
if (
not self.server_args.disable_hybrid_swa_memory
and self.sliding_window_size is not None
@@ -1008,8 +1009,11 @@ class ModelRunner:
try:
layers = self.model.language_model.model.layers
except:
self.is_hybrid = False
return
try:
layers = self.model.language_model.layers
except:
self.is_hybrid = False
return
for layer in layers:
if (