Skip to content

Commit 61f340b

Browse files
author
Roger Wang
committed
add details
Signed-off-by: Roger Wang <[email protected]> Signed-off-by: Roger Wang <[email protected]>
1 parent b19e3d4 commit 61f340b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

vllm/v1/engine/processor.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,14 @@ def _validate_model_input(
473473

474474
# NOTE: tokenizer.max_token_id is the tokenizer’s vocab size while
475475
# self.model_config.get_vocab_size() is the model’s vocab size.
476-
# For some models, certain tokens exist in one but not the other,
477-
# so we take the max of the two to decide if a token id is truly
478-
# out-of-vocabulary.
476+
# For Qwen3 models, the language model has extra tokens that do
477+
# not exist in the tokenizer, and vice versa for multimodal
478+
# placeholder tokens in some multimodal models.
479+
# See https://github.com/QwenLM/Qwen3/issues/29#issuecomment-1933720399 # noqa: E501
480+
# and https://github.com/vllm-project/vllm/pull/22471#discussion_r2312251421 # noqa: E501
481+
482+
# Here we take the max of the two to determine if a token id is
483+
# truly out-of-vocabulary.
479484
if max_input_id > max(tokenizer.max_token_id,
480485
self.model_config.get_vocab_size() - 1):
481486
raise ValueError(

0 commit comments

Comments
 (0)