-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Frontend] support image embeds #13955
base: main
Are you sure you want to change the base?
Conversation
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
48efb69
to
3f8bfbf
Compare
3f8bfbf
to
29be721
Compare
After merging #14017, can you update the Multimodal Inputs documentation page with an example on how to pass embedding inputs in online inference? Thanks |
I think we should not use data URL to pass the image embeddings. You can directly pass the binary array data to be decoded on server side (similar to the format of |
31150c8
to
088a85f
Compare
088a85f
to
7b35076
Compare
Signed-off-by: chaunceyjiang <[email protected]>
7b35076
to
aba83db
Compare
embeds["image_embeds"] = embedding # decoded image data | ||
embeds |= self._parse_image_embeds_params(image_embeds) | ||
|
||
placeholder = self._tracker.add("image", embeds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DarkLight1337
I'm a bit confused about this part.
After embeds
is added to _items_by_modality
, it will be processed into
multi_modal_data = {
"image": [{
"image_embeds": image_embeds,
# image_grid_thw is needed to calculate positional encoding.
"image_grid_thw": torch.load(...), # torch.Tensor of shape (1, 3),
}] #### <<<<<<- This is a list.
}
https://docs.vllm.ai/en/latest/serving/multimodal_inputs.html#embedding-inputs
multi_modal_data = {
"image": {
"image_embeds": image_embeds,
# image_grid_thw is needed to calculate positional encoding.
"image_grid_thw": torch.load(...), # torch.Tensor of shape (1, 3),
} #### <<<<<- This is a dict.
}
I believe I should convert the image_embeds passed by the user into the format mentioned above to pass to the VLLM engine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The data in the tracker is split by multimodal items. You should perform an extra step when combining the inputs together to convert from list of dicts to dict of lists.
Fix #13540