-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Make the cv2 dependency optional #27780
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 correctly makes the cv2 dependency optional by moving its import from the top level of vllm/benchmarks/datasets.py to within the generate_synthetic_video function, which is the only place it's used in that file. This change is well-aligned with the goal of preventing cv2 from being a required dependency for all vLLM commands. The implementation is clean and follows a common pattern for handling optional dependencies, improving the project's dependency management without introducing any issues. The change is approved.
This statement is not correct. |
It's not rigorously correct, but at least here is the only place where cv2 was explicitly imported. |
Signed-off-by: Jacob <cmpute@qq.com>
|
@ZJY0516 Could you mark this MR as reviewed please? I have updated the commit with the sign-off message. |
Signed-off-by: Jacob <cmpute@qq.com>
Signed-off-by: Jacob <cmpute@qq.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Signed-off-by: Jacob <cmpute@qq.com>
Purpose
The latest code will requires the
cv2dependency (no matter command you run, because it's imported by default), and it's completely not necessary (it's only used in benchmark). This PR move cv2 inside the function it's called, to prevent cv2 to be imported by default.The motivation to remove cv2 is that, it's hard to maintain opencv package consistency if you run vllm along with other related packages.
Test Plan
None
Test Result
None
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.