Skip to content

Commit dd2a945

Browse files
authored
[Model] Allow the use of sliding window in Qwen2 (#17772)
Signed-off-by: inkcherry <[email protected]>
1 parent 420caf7 commit dd2a945

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

vllm/model_executor/models/qwen2.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,14 @@ def __init__(self,
291291
# TODO (@robertgshaw2): see if this can be moved out
292292
if (cache_config.sliding_window is not None
293293
and hasattr(config, "max_window_layers")):
294-
raise ValueError("Sliding window for some but all layers is not "
295-
"supported. This model uses sliding window "
296-
"but `max_window_layers` = {} is less than "
297-
"`num_hidden_layers` = {}. Please open an issue "
298-
"to discuss this feature.".format(
299-
config.max_window_layers,
300-
config.num_hidden_layers,
301-
))
294+
assert config.max_window_layers == config.num_hidden_layers, (
295+
"Sliding window for some but all layers is not supported. "
296+
"This model uses sliding window but `max_window_layers` = {} "
297+
"is less than `num_hidden_layers` = {}. Please open an issue "
298+
"to discuss this feature.".format(
299+
config.max_window_layers,
300+
config.num_hidden_layers,
301+
))
302302

303303
self.config = config
304304
self.quant_config = quant_config

0 commit comments

Comments
 (0)