Unverified Commit 55e081fb authored by hhzhang16's avatar hhzhang16 Committed by GitHub
Browse files

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

parent 8e836d98
...@@ -342,6 +342,8 @@ class InternVLInputPipeline: ...@@ -342,6 +342,8 @@ class InternVLInputPipeline:
elif is_list_of(data, Image.Image): elif is_list_of(data, Image.Image):
# we can't stack here because images may have different num_patches # we can't stack here because images may have different num_patches
data = [image_pixel_values_mapper(img) for img in data] data = [image_pixel_values_mapper(img) for img in data]
else:
return MultiModalInputs({"image_embeds": data})
model_config = ctx.model_config model_config = ctx.model_config
tokenizer = cached_get_tokenizer( tokenizer = cached_get_tokenizer(
model_config.tokenizer, model_config.tokenizer,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment