-
-
Notifications
You must be signed in to change notification settings - Fork 22.3k
[Bugfix][Multimodal] Guard GLMGA video sampling against zero source fps #54396
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -813,6 +813,14 @@ def compute_frames_index_to_sample( | |
| max_frame_idx = source.total_frames_num - 1 | ||
| max_frames = min(kwargs.get("max_frames", cls._MAX_FRAMES), cls._MAX_FRAMES) | ||
|
|
||
| # vLLM reports original_fps == 0 for clips with unknown/variable fps | ||
| # (VFR, malformed, streaming); fail loudly instead of dividing by zero. | ||
| if original_fps <= 0: | ||
| raise ValueError( | ||
| "GLMGA video sampling needs a known source fps, but the " | ||
| "container reported 0 (variable or unknown frame rate)." | ||
|
Comment on lines
+816
to
+821
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Describe the entire rejected FPS range. This branch rejects every 🤖 Prompt for AI Agents |
||
| ) | ||
|
|
||
| duration = duration or round(max_frame_idx / original_fps) + 1 | ||
|
|
||
| extract_t = int(duration * target_fps) | ||
|
|
||
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Run the assertion for both duration cases.
The
pytest.raisesblock is outside thefor durationloop. The loop creates both sources, but the assertion runs only once with the finalduration=0.0source. The regression test does not cover the reported-duration path. Indent the assertion into the loop or parameterizeduration.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents