From 0add5560868fbd6894d12db762da1f65d793474c Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Fri, 20 Dec 2024 15:32:36 -0800 Subject: [PATCH] [V1][Bugfix] Skip empty or None mm_data Signed-off-by: Woosuk Kwon --- vllm/v1/engine/mm_input_mapper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vllm/v1/engine/mm_input_mapper.py b/vllm/v1/engine/mm_input_mapper.py index 218724bff6bba..8bfc739b3dbbc 100644 --- a/vllm/v1/engine/mm_input_mapper.py +++ b/vllm/v1/engine/mm_input_mapper.py @@ -180,6 +180,10 @@ def hash_prompt_mm_data(self, prompt: PromptType) -> Optional[List[str]]: return None mm_data = prompt["multi_modal_data"] + if not mm_data: + # mm_data can be None or an empty dict. + return None + image_inputs = mm_data["image"] return self.hash_images(image_inputs)