Skip to content

Commit 5136c51

Browse files
davidheinemanlionelvillard
authored andcommitted
[Bugfix] Revert max_prompt_len validation for decoder-only models. (vllm-project#16741)
Signed-off-by: David Heineman <[email protected]>
1 parent c15451b commit 5136c51

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

vllm/engine/llm_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2062,7 +2062,7 @@ def _validate_model_input(
20622062
raise ValueError(f"The {prompt_type} prompt cannot be empty")
20632063

20642064
max_prompt_len = self.model_config.max_model_len
2065-
if len(prompt_ids) >= max_prompt_len:
2065+
if len(prompt_ids) > max_prompt_len:
20662066
if prompt_type == "encoder" and model_config.is_multimodal_model:
20672067
mm_registry = self.input_preprocessor.mm_registry
20682068
mm_processor = mm_registry.create_processor(

vllm/v1/engine/processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def _validate_model_input(
354354
raise ValueError(f"Token id {max_input_id} is out of vocabulary")
355355

356356
max_prompt_len = self.model_config.max_model_len
357-
if len(prompt_ids) >= max_prompt_len:
357+
if len(prompt_ids) > max_prompt_len:
358358
if prompt_type == "encoder" and model_config.is_multimodal_model:
359359
mm_registry = self.input_preprocessor.mm_registry
360360
mm_processor = mm_registry.create_processor(

0 commit comments

Comments
 (0)