-
-
Notifications
You must be signed in to change notification settings - Fork 15.7k
[Bugfix] Fix broken v0 multimodal inference #19814
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -683,7 +683,7 @@ def get_input_embeddings( | |
| multimodal_embeddings: Optional[MultiModalEmbeddings] = None, | ||
| ) -> torch.Tensor: | ||
| inputs_embeds = self.language_model.get_input_embeddings(input_ids) | ||
| if multimodal_embeddings is not None: | ||
| if multimodal_embeddings: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change from As per the PR description, the previous condition ( If The new condition |
||
| inputs_embeds = merge_multimodal_embeddings( | ||
| input_ids, | ||
| inputs_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.
The change from
multimodal_embeddings is not Nonetoif multimodal_embeddings:in this documentation example correctly reflects the corresponding code changes. This updated condition is more Pythonic and robustly handles cases wheremultimodal_embeddingsmight be an empty list or tuple (which evaluates toFalse), in addition toNone.