Skip to content

Commit d992f22

Browse files
committed
change to assert
Signed-off-by: Sugar-zsg <[email protected]>
1 parent 85a8854 commit d992f22

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

vllm/attention/layers/cross_attention.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@
2525
def _get_max_encoder_len(vllm_config: "VllmConfig") -> int:
2626
"""Gets the max number of encoder input tokens from the config.
2727
"""
28-
max_len = vllm_config.scheduler_config.max_num_encoder_input_tokens
29-
30-
if isinstance(max_len, int) and max_len > 0:
31-
return max_len
32-
33-
return 0
28+
sc = vllm_config.scheduler_config
29+
assert sc and isinstance(sc.max_num_encoder_input_tokens, int), \
30+
"max_num_encoder_input_tokens must be int for enc-dec models"
31+
return sc.max_num_encoder_input_tokens
3432

3533

3634
def _get_cross_slot_mapping(encoder_seq_lens: np.ndarray,

0 commit comments

Comments
 (0)