-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support different image sizes in prefill in VLMs #2065
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
...on-tests/models/__snapshots__/test_flash_pali_gemma/test_flash_pali_gemma_two_images.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"details": { | ||
"best_of_sequences": null, | ||
"finish_reason": "eos_token", | ||
"generated_tokens": 8, | ||
"prefill": [], | ||
"seed": null, | ||
"tokens": [ | ||
{ | ||
"id": 2502, | ||
"logprob": -1.734375, | ||
"special": false, | ||
"text": "image" | ||
}, | ||
{ | ||
"id": 2196, | ||
"logprob": -0.5756836, | ||
"special": false, | ||
"text": " result" | ||
}, | ||
{ | ||
"id": 604, | ||
"logprob": -0.007843018, | ||
"special": false, | ||
"text": " for" | ||
}, | ||
{ | ||
"id": 12254, | ||
"logprob": -1.7167969, | ||
"special": false, | ||
"text": " chicken" | ||
}, | ||
{ | ||
"id": 611, | ||
"logprob": -0.17053223, | ||
"special": false, | ||
"text": " on" | ||
}, | ||
{ | ||
"id": 573, | ||
"logprob": -0.7626953, | ||
"special": false, | ||
"text": " the" | ||
}, | ||
{ | ||
"id": 8318, | ||
"logprob": -0.02709961, | ||
"special": false, | ||
"text": " beach" | ||
}, | ||
{ | ||
"id": 1, | ||
"logprob": -0.20739746, | ||
"special": true, | ||
"text": "<eos>" | ||
} | ||
], | ||
"top_tokens": null | ||
}, | ||
"generated_text": "image result for chicken on the beach" | ||
} |
85 changes: 85 additions & 0 deletions
85
integration-tests/models/__snapshots__/test_idefics/test_idefics_two_images.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"details": { | ||
"best_of_sequences": null, | ||
"finish_reason": "eos_token", | ||
"generated_tokens": 12, | ||
"prefill": [], | ||
"seed": null, | ||
"tokens": [ | ||
{ | ||
"id": 450, | ||
"logprob": -0.26342773, | ||
"special": false, | ||
"text": " The" | ||
}, | ||
{ | ||
"id": 21282, | ||
"logprob": -0.01838684, | ||
"special": false, | ||
"text": " cow" | ||
}, | ||
{ | ||
"id": 322, | ||
"logprob": -0.18041992, | ||
"special": false, | ||
"text": " and" | ||
}, | ||
{ | ||
"id": 521, | ||
"logprob": -0.62841797, | ||
"special": false, | ||
"text": " ch" | ||
}, | ||
{ | ||
"id": 21475, | ||
"logprob": -0.0037956238, | ||
"special": false, | ||
"text": "icken" | ||
}, | ||
{ | ||
"id": 526, | ||
"logprob": -0.018737793, | ||
"special": false, | ||
"text": " are" | ||
}, | ||
{ | ||
"id": 373, | ||
"logprob": -1.0820312, | ||
"special": false, | ||
"text": " on" | ||
}, | ||
{ | ||
"id": 263, | ||
"logprob": -0.5083008, | ||
"special": false, | ||
"text": " a" | ||
}, | ||
{ | ||
"id": 25695, | ||
"logprob": -0.07128906, | ||
"special": false, | ||
"text": " beach" | ||
}, | ||
{ | ||
"id": 29889, | ||
"logprob": -0.12573242, | ||
"special": false, | ||
"text": "." | ||
}, | ||
{ | ||
"id": 32002, | ||
"logprob": -0.0029792786, | ||
"special": true, | ||
"text": "<end_of_utterance>" | ||
}, | ||
{ | ||
"id": 2, | ||
"logprob": -0.00024962425, | ||
"special": true, | ||
"text": "</s>" | ||
} | ||
], | ||
"top_tokens": null | ||
}, | ||
"generated_text": " The cow and chicken are on a beach." | ||
} |
133 changes: 133 additions & 0 deletions
133
integration-tests/models/__snapshots__/test_idefics2/test_flash_idefics2_two_images.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
{ | ||
"details": { | ||
"best_of_sequences": null, | ||
"finish_reason": "length", | ||
"generated_tokens": 20, | ||
"prefill": [], | ||
"seed": null, | ||
"tokens": [ | ||
{ | ||
"id": 415, | ||
"logprob": -0.04421997, | ||
"special": false, | ||
"text": " The" | ||
}, | ||
{ | ||
"id": 12072, | ||
"logprob": -0.13500977, | ||
"special": false, | ||
"text": " cow" | ||
}, | ||
{ | ||
"id": 349, | ||
"logprob": -0.06750488, | ||
"special": false, | ||
"text": " is" | ||
}, | ||
{ | ||
"id": 6328, | ||
"logprob": -0.6352539, | ||
"special": false, | ||
"text": " standing" | ||
}, | ||
{ | ||
"id": 356, | ||
"logprob": -0.16186523, | ||
"special": false, | ||
"text": " on" | ||
}, | ||
{ | ||
"id": 272, | ||
"logprob": -0.5078125, | ||
"special": false, | ||
"text": " the" | ||
}, | ||
{ | ||
"id": 10305, | ||
"logprob": -0.017913818, | ||
"special": false, | ||
"text": " beach" | ||
}, | ||
{ | ||
"id": 304, | ||
"logprob": -1.5205078, | ||
"special": false, | ||
"text": " and" | ||
}, | ||
{ | ||
"id": 272, | ||
"logprob": -0.029174805, | ||
"special": false, | ||
"text": " the" | ||
}, | ||
{ | ||
"id": 13088, | ||
"logprob": -0.003479004, | ||
"special": false, | ||
"text": " chicken" | ||
}, | ||
{ | ||
"id": 349, | ||
"logprob": -0.0035095215, | ||
"special": false, | ||
"text": " is" | ||
}, | ||
{ | ||
"id": 6398, | ||
"logprob": -0.3088379, | ||
"special": false, | ||
"text": " sitting" | ||
}, | ||
{ | ||
"id": 356, | ||
"logprob": -0.027755737, | ||
"special": false, | ||
"text": " on" | ||
}, | ||
{ | ||
"id": 264, | ||
"logprob": -0.31884766, | ||
"special": false, | ||
"text": " a" | ||
}, | ||
{ | ||
"id": 17972, | ||
"logprob": -0.047943115, | ||
"special": false, | ||
"text": " pile" | ||
}, | ||
{ | ||
"id": 302, | ||
"logprob": -0.0002925396, | ||
"special": false, | ||
"text": " of" | ||
}, | ||
{ | ||
"id": 2445, | ||
"logprob": -0.02935791, | ||
"special": false, | ||
"text": " money" | ||
}, | ||
{ | ||
"id": 28723, | ||
"logprob": -0.031219482, | ||
"special": false, | ||
"text": "." | ||
}, | ||
{ | ||
"id": 32002, | ||
"logprob": -0.00034475327, | ||
"special": true, | ||
"text": "<end_of_utterance>" | ||
}, | ||
{ | ||
"id": 2, | ||
"logprob": -1.1920929e-07, | ||
"special": true, | ||
"text": "</s>" | ||
} | ||
], | ||
"top_tokens": null | ||
}, | ||
"generated_text": " The cow is standing on the beach and the chicken is sitting on a pile of money." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
ha this is interesting!
I wonder if we should identify and throw an error for models that limit the number of images in the future?
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.
That sounds like a useful validation. Not sure which models are supposed to handle multiple images in one prompt.