@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / c21b99b912
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 18:30 UTC

[Bugfix][VLM] fix llava processor (#15285)

Signed-off-by: Mengqing Cao <cmq0113@163.com>

Mengqing Cao committed Mar 21, 2025 at 20:14 UTC c21b99b91241409c2fdf9f3f8c542e8748b317be
1 file changed +7 -1
vllm/model_executor/models/llava.py
+7 -1
@@ -233,7 +233,13 @@ class LlavaDummyInputsBuilder(BaseDummyInputsBuilder[_I]):
233 class LlavaProcessingInfo(BaseLlavaProcessingInfo):
234
235 def get_hf_processor(self, **kwargs: object):
236 - return self.ctx.get_hf_processor(LlavaProcessor, **kwargs)
236 + hf_processor = self.ctx.get_hf_processor(LlavaProcessor, **kwargs)
237 + # In case patch_size is omitted from `processor_config.json`
238 + # e.g. for E5-V: https://huggingface.co/royokong/e5-v
239 + if hf_processor.patch_size is None:
240 + patch_size = self.get_vision_encoder_info().get_patch_size()
241 + hf_processor.patch_size = patch_size
242 + return hf_processor
243
244
245 class BaseLlavaMultiModalProcessor(BaseMultiModalProcessor[_I]):