Skip to content

Commit 36e7670

Browse files
authored
[Bugfix] Validate and concatenate image embeddings in MiniCPMVBaseModel (#11631)
1 parent 5886aa4 commit 36e7670

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vllm/model_executor/models/minicpmv.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,12 @@ def _parse_and_validate_inputs(
487487
image_embeds = kwargs.pop("image_embeds", None)
488488

489489
if image_embeds is not None:
490+
if not isinstance(image_embeds, (torch.Tensor, list)):
491+
raise ValueError(f"Incorrect type of image embeds. "
492+
f"Got type: {type(image_embeds)}")
493+
if isinstance(image_embeds, list):
494+
image_embeds = torch.concat(image_embeds)
495+
490496
return MiniCPMVImageEmbeddingInputs(
491497
image_bounds=self._get_image_bounds(input_ids, im_start_id,
492498
im_end_id, slice_start_id,

0 commit comments

Comments
 (0)