Skip to content

Commit 46a5079

Browse files
committed
allow empty list
1 parent 4224be5 commit 46a5079

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vllm/model_executor/models/minicpmv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def input_mapper_for_minicpmv(ctx: InputContext, data: object):
375375
raise RuntimeError("No HuggingFace processor is available "
376376
"to process the image object")
377377

378-
if not isinstance(data, list) or len(data) <= 0:
378+
if not isinstance(data, list):
379379
raise ValueError("Invalid image input (%s)", data)
380380

381381
try:
@@ -386,7 +386,7 @@ def input_mapper_for_minicpmv(ctx: InputContext, data: object):
386386
logger.error("Failed to process image (%s)", data)
387387
raise
388388

389-
if "image_bounds" in data[0]:
389+
if len(data) > 0 and "image_bounds" in data[0]:
390390
batch_data["image_bounds"] = data[0]["image_bounds"]
391391

392392
return MultiModalInputs(batch_data)

0 commit comments

Comments
 (0)