Revert "lang: support direct video inference"#12038
Conversation
This reverts commit 823b442.
Summary of ChangesHello @merrymercy, 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 refactors the existing video inference support by transitioning from a dedicated video processing pipeline to one that encodes videos into base64 and treats them as sequences of images. This change involves introducing a new video encoding utility, removing specific video handling logic from the backend and chat templates, and integrating video processing into the existing image handling framework within the interpreter. 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 reverts the changes from a previous commit. The revert appears to be incomplete, leading to a broken state. Specifically, the _execute_video method in python/sglang/lang/interpreter.py is restored to a version that depends on self.videos_ and self.chat_template.video_token. However, these attributes are removed in other parts of this same PR, which will cause runtime AttributeErrors. This critical inconsistency needs to be addressed to ensure the codebase is functional after this revert.
|
|
||
| base64_data = encode_video_base64(path, num_frames) |
There was a problem hiding this comment.
This restored implementation of _execute_video will cause a runtime error. It relies on self.videos_ and self.chat_template.video_token, but the definitions for these have been removed in this same pull request:
- The
videos_attribute is removed from theStreamExecutorclass in this same file (in__init__andfork). - The
video_tokenattribute is removed from theChatTemplateclass inpython/sglang/lang/chat_template.py.
As a result, executing this code will raise an AttributeError. Please correct the revert to ensure the code is consistent. It seems this function should either be removed entirely if the video feature is being fully reverted, or the dependencies (videos_ and video_token) should be restored as well.
Reverts #9936
because the lint failed