[Bugfix] Update InternVL input mapper to support image embeds (#9351)

This commit is contained in:
hhzhang16 2024-10-14 21:29:19 -07:00 committed by GitHub
parent 8e836d982a
commit 55e081fbad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -342,6 +342,8 @@ class InternVLInputPipeline:
elif is_list_of(data, Image.Image):
# we can't stack here because images may have different num_patches
data = [image_pixel_values_mapper(img) for img in data]
else:
return MultiModalInputs({"image_embeds": data})
model_config = ctx.model_config
tokenizer = cached_get_tokenizer(
model_config.tokenizer,