-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Add 'path' option to ImagePrompt data_format #25081
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
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run You ask your reviewers to trigger select CI tests on top of Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. 🚀 |
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 adds the path
option for data_format
in the ImagePrompt
model, allowing local file paths to be used as image inputs for the prithvi_io_processor
plugin. The change itself is correct, but it lacks corresponding tests to validate the new functionality. Additionally, I've identified a pre-existing issue with the bytes
data format option on the same line, which appears to be non-functional. I've added comments with suggestions to address both points to improve the robustness and correctness of the plugin.
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.
While this change correctly adds the path
option to data_format
, the new functionality is not covered by any tests. To ensure correctness and prevent future regressions, please add a test case for data_format: "path"
in tests/plugins_tests/test_io_processor_plugins.py
. You could add a new test function or parameterize an existing one to handle the path
case, for example by downloading the test image to a temporary file and passing its path.
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.
The "bytes"
option in data_format
appears to be non-functional. The load_image
function in prithvi_processor.py
expects a list of strings, but for data_format="bytes"
it would receive a list containing a bytes object. The logic to handle bytes data within load_image
is commented out, and read_geotiff
is not called correctly for this case. This will lead to a runtime error. Since you are modifying this line, it would be beneficial to either fix the implementation for "bytes"
or remove it from the Literal
to avoid confusion.
Signed-off-by: Gerard Finol <[email protected]>
422eb9d
to
13cd005
Compare
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.
cc @christian-pinto can you review this?
Sure |
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.
Looks good, great catch
Signed-off-by: Gerard Finol <[email protected]>
Signed-off-by: Gerard Finol <[email protected]>
Signed-off-by: Gerard Finol <[email protected]> Signed-off-by: charlifu <[email protected]>
Signed-off-by: Gerard Finol <[email protected]> Signed-off-by: xuebwang-amd <[email protected]>
Signed-off-by: Gerard Finol <[email protected]>
Purpose
This PR adds the
"path"
option todata_format
inImagePrompt
for theprithvi_io_processor
plugin.Notice that the plugin already supports that option, but fails when used with a file because of the pydantic check.
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.