-
Notifications
You must be signed in to change notification settings - Fork 28.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
[chat-template] Unify tests and clean up 🧼 #37275
base: main
Are you sure you want to change the base?
Conversation
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
ready for review :) |
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.
Merging the model-specific tests into a common test makes a lot of sense! One comment, but otherwise this LGTM
# TODO: raushan, has to be public method under `VideoProcessorBase` when API is added | ||
def _load_video_for_model( |
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.
Making sure I understand this: When we have a proper VideoProcessorBase
API, there won't be model-specific _load_video_for_model
methods anymore?
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.
There will be model-specific method, in each video processor. Currently we have models loading videos with different sampling (SmolVLM) or even resizing (Qwen-Omni), even before the video is processed
As a second option, we can consider merging all these steps into self.preprocess(videos)
as long as it doesn't slow it down. Haven't thought about it, but since you mentioned it that sounds interesting. I'll give it a try after API initial design is merged (under review still)
What does this PR do?
As per title, we added the video loading logic in rush for SmolVLM. But the API is a bit over-complicated, so the decision was to clean up later. As the first step of clean up, we will
sampling_fn
from public kwargs, I don't think anyone uses it so we will not deprecatetest_chat_template_return_dict_torch