[model-gateway] add qwen2.5_vl model image processor#14375
Conversation
Summary of ChangesHello @slin1237, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for the qwen2.5_vl model by mapping it to the existing Qwen2VLProcessor. The changes are straightforward, mainly involving new model name registrations and documentation updates. My feedback focuses on improving code maintainability by reducing duplication in the registration logic and enhancing consistency in the documentation.
| // Register Qwen2.5-VL (uses identical preprocessing to Qwen2-VL) | ||
| registry.register( | ||
| "qwen2.5-vl", | ||
| Box::new(super::processors::Qwen2VLProcessor::new()), | ||
| ); | ||
| registry.register( | ||
| "qwen2_5-vl", | ||
| Box::new(super::processors::Qwen2VLProcessor::new()), | ||
| ); | ||
| registry.register( | ||
| "qwen2_5_vl", | ||
| Box::new(super::processors::Qwen2VLProcessor::new()), | ||
| ); |
There was a problem hiding this comment.
To improve maintainability and reduce code duplication, you can use a loop to register the different patterns for Qwen2.5-VL since they all use the same processor.
| // Register Qwen2.5-VL (uses identical preprocessing to Qwen2-VL) | |
| registry.register( | |
| "qwen2.5-vl", | |
| Box::new(super::processors::Qwen2VLProcessor::new()), | |
| ); | |
| registry.register( | |
| "qwen2_5-vl", | |
| Box::new(super::processors::Qwen2VLProcessor::new()), | |
| ); | |
| registry.register( | |
| "qwen2_5_vl", | |
| Box::new(super::processors::Qwen2VLProcessor::new()), | |
| ); | |
| // Register Qwen2.5-VL (uses identical preprocessing to Qwen2-VL) | |
| for pattern in ["qwen2.5-vl", "qwen2_5-vl", "qwen2_5_vl"] { | |
| registry.register( | |
| pattern, | |
| Box::new(super::processors::Qwen2VLProcessor::new()), | |
| ); | |
| } |
| //! - **LLaVA 1.5** (`llava`): CLIP-based preprocessing with configurable aspect ratio | ||
| //! - **LLaVA-NeXT** (`llava`): Multi-crop anyres processing | ||
| //! - **Qwen2-VL** (`qwen2_vl`): Dynamic resolution with smart resizing | ||
| //! - **Qwen2.5-VL** (`qwen2_vl`): Same processor as Qwen2-VL (identical preprocessing) |
There was a problem hiding this comment.
For consistency with the registration keys in image_processor.rs and the model_name() function in qwen2_vl.rs (which returns "qwen2-vl"), it would be clearer to use qwen2.5-vl here as the example pattern.
| //! - **Qwen2.5-VL** (`qwen2_vl`): Same processor as Qwen2-VL (identical preprocessing) | |
| //! - **Qwen2.5-VL** (`qwen2.5-vl`): Same processor as Qwen2-VL (identical preprocessing) |
Checklist