-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
[Misc] Simplify max tokens in multimodal registry #27500
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
[Misc] Simplify max tokens in multimodal registry #27500
Conversation
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
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.
Code Review
This pull request correctly simplifies the logic for determining the maximum tokens for multimodal models by removing the redundant get_max_tokens_per_item_by_nonzero_modality function and avoiding the double creation of the multimodal processor within get_max_tokens_per_item_by_modality. The changes are clean and improve efficiency. However, I've identified a similar inefficiency in MultiModalBudget.__init__ where the processor is still created twice. Addressing this would further align with the goals of this PR.
|
Looks like the one of the tests didn't pass cc @DarkLight1337 |
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
|
Fixed in 10532e5 |
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
Purpose
get_max_tokens_per_item_by_nonzero_modalityis redundant becauseget_max_tokens_per_item_by_modalityalready considers the limits by only passing in modalities withlimit > 0.get_max_tokens_per_item_by_modality.Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.