From 2843784c1cc1ca8118d416a1902ed334a0dde3d2 Mon Sep 17 00:00:00 2001 From: yurekami Date: Wed, 24 Dec 2025 23:23:59 +0900 Subject: [PATCH] fix: handle None tokenizer in multimodal processor initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When skip_tokenizer_init=True is set, the tokenizer is None. Previously, this None value was unconditionally passed to the processor, which overrode the processor's ability to load its own tokenizer from the model path. This caused crashes in multimodal models like gemma-3 that require a tokenizer during processor initialization. The fix is to only pass the tokenizer kwarg when it's not None, allowing the processor to load its own tokenizer when skip_tokenizer_init=True. Fixes #31123 Signed-off-by: yurekami <69337011+yurekami@users.noreply.github.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 Signed-off-by: yurekami --- vllm/multimodal/processing.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vllm/multimodal/processing.py b/vllm/multimodal/processing.py index 3bbdab3b393c5..0f247603cc443 100644 --- a/vllm/multimodal/processing.py +++ b/vllm/multimodal/processing.py @@ -1046,10 +1046,19 @@ class InputProcessingContext: typ = ProcessorMixin + # Only pass tokenizer if not None to allow the processor to + # load its own tokenizer from the model path when skip_tokenizer_init + # is True. Passing tokenizer=None would override the processor's + # tokenizer loading and cause crashes in multimodal models that + # require a tokenizer during processor initialization. + tokenizer_kwargs = {} + if self.tokenizer is not None: + tokenizer_kwargs["tokenizer"] = self.tokenizer + return cached_processor_from_config( self.model_config, processor_cls=typ, - tokenizer=self.tokenizer, + **tokenizer_kwargs, **kwargs, )