-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Fix multimodal processor get duplicate arguments when receive kwargs for initialization #39125
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
Conversation
Signed-off-by: Isotr0py <[email protected]>
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. |
Signed-off-by: Isotr0py <[email protected]>
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.
Thanks, looks good. I think this has a lot of assumptions about the order of args in the __init__
, but I guess the codebase currently follows consistent ordering (🤞🏻 )
Can you add a small test in test_processing_common
where one of the attributes can be arbitrarily overriden by a user?
Signed-off-by: Isotr0py <[email protected]>
Seems like it broke a whole lot of tests... |
Signed-off-by: Isotr0py <[email protected]>
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.
Thanks, we'll patch it today
Signed-off-by: Isotr0py <[email protected]>
…for initialization (#39125) * fix processor tokenizer override Signed-off-by: Isotr0py <[email protected]> * code format Signed-off-by: Isotr0py <[email protected]> * add regression test Signed-off-by: Isotr0py <[email protected]> * fix Signed-off-by: Isotr0py <[email protected]> * check image processor same Signed-off-by: Isotr0py <[email protected]> --------- Signed-off-by: Isotr0py <[email protected]>
What does this PR do?
Also reported in vllm-project/vllm#19833
The current processor arguments revolving logic can hit
TypeError: Qwen2VLProcessor.__init__() got multiple values for argument 'tokenizer'
if we passed tokenizer as a kwargs. Because it will remove unused args, which caused an incorrect args order and raiseTypeError: Qwen2VLProcessor.__init__() got multiple values for argument 'tokenizer'
.For example, Qwen2-VL receive
(image_processor, tokenizer, video_processor)
as args, if we passedtokenizer
as kwargs, it will be removed from args, which will become(image_processor, video_processor)
and passvideo_processor
as tokenizer:transformers/src/transformers/models/qwen2_vl/processing_qwen2_vl.py
Line 78 in 4a79bf9
Code to reproduce
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.