mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-05-30 17:27:11 +08:00
[Model] Allow the use of sliding window in Qwen2 (#17772)
Signed-off-by: inkcherry <mingzhi.liu@intel.com>
This commit is contained in:
parent
420caf7557
commit
dd2a94596a
@ -291,14 +291,14 @@ class Qwen2Model(nn.Module):
|
|||||||
# TODO (@robertgshaw2): see if this can be moved out
|
# TODO (@robertgshaw2): see if this can be moved out
|
||||||
if (cache_config.sliding_window is not None
|
if (cache_config.sliding_window is not None
|
||||||
and hasattr(config, "max_window_layers")):
|
and hasattr(config, "max_window_layers")):
|
||||||
raise ValueError("Sliding window for some but all layers is not "
|
assert config.max_window_layers == config.num_hidden_layers, (
|
||||||
"supported. This model uses sliding window "
|
"Sliding window for some but all layers is not supported. "
|
||||||
"but `max_window_layers` = {} is less than "
|
"This model uses sliding window but `max_window_layers` = {} "
|
||||||
"`num_hidden_layers` = {}. Please open an issue "
|
"is less than `num_hidden_layers` = {}. Please open an issue "
|
||||||
"to discuss this feature.".format(
|
"to discuss this feature.".format(
|
||||||
config.max_window_layers,
|
config.max_window_layers,
|
||||||
config.num_hidden_layers,
|
config.num_hidden_layers,
|
||||||
))
|
))
|
||||||
|
|
||||||
self.config = config
|
self.config = config
|
||||||
self.quant_config = quant_config
|
self.quant_config = quant_config
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user