Skip to content

Commit

Permalink
allow empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeitong committed Sep 20, 2024
1 parent 033fc69 commit 7b34c99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vllm/model_executor/models/minicpmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def input_mapper_for_minicpmv(ctx: InputContext, data: object):
raise RuntimeError("No HuggingFace processor is available "
"to process the image object")

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

try:
Expand All @@ -392,7 +392,7 @@ def input_mapper_for_minicpmv(ctx: InputContext, data: object):
logger.error("Failed to process image (%s)", data)
raise

if "image_bounds" in data[0]:
if len(data) > 0 and "image_bounds" in data[0]:
batch_data["image_bounds"] = data[0]["image_bounds"]

return MultiModalInputs(batch_data)
Expand Down

0 comments on commit 7b34c99

Please sign in to comment.