Skip to content

Commit

Permalink
[Bugfix] Fix error handling of unsupported sliding window (#11213)
Browse files Browse the repository at this point in the history
Signed-off-by: DarkLight1337 <[email protected]>
  • Loading branch information
DarkLight1337 authored Dec 15, 2024
1 parent b10609e commit 96d673e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions vllm/model_executor/models/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,15 @@ def __init__(
)

if hasattr(config, "interleaved_sliding_window"):
if isinstance(config.interleaved_sliding_window, int):
sliding_window = config.interleaved_sliding_window
elif isinstance(config.interleaved_sliding_window, list):
sw_idx = layer_idx % len(config.interleaved_sliding_window)
sliding_window = config.interleaved_sliding_window[sw_idx]
interleaved_sliding_window = config.interleaved_sliding_window
if isinstance(interleaved_sliding_window, int):
sliding_window = interleaved_sliding_window
elif isinstance(interleaved_sliding_window, list):
sw_idx = layer_idx % len(interleaved_sliding_window)
sliding_window = interleaved_sliding_window[sw_idx]
else:
raise ValueError(f"{type(sliding_window)} is not supported.")
raise ValueError(
f"{type(interleaved_sliding_window)} is not supported.")
else:
sliding_window = None

Expand Down

0 comments on commit 96d673e

Please sign in to comment.