fix(oryx): make the video call sites match what load_video/read_video return - #1493
Merged
pufanyi merged 1 commit intoAug 31, 2026
Merged
Conversation
… return load_video returns (frames, modality) and read_video returns only the frame array; two call sites disagreed with both.
pufanyi
self-requested a review
August 31, 2026 07:34
pufanyi
approved these changes
Aug 31, 2026
Collaborator
|
Thanks for your contribution! I will merge it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Oryx.load_videoreturns a 2-tuple:and the shared helper
read_videoreturns a barenp.ndarray:Two call sites in
oryx.pydisagree with those contracts, in two different ways.1.
generate_until, thepyavbranch (line 355)read_videohands back(N, H, W, 3), so the unpack splits it along the frame axis:max_frames_num=32it raisesValueError: too many values to unpack (expected 2);videosilentlybecomes a single
(H, W, 3)frame andmodalitybecomes another raw frame instead ofthe string
"video". The followingfor frame in video:then iterates over pixel rows,and
modalities.append(modality)appends an array where the model expects a tag.The
decordbranch three lines above is the correct sibling; thepyavbranch wasevidently copied from it without adapting to
read_video's return type.2.
loglikelihood(line 238)This drops the unpack entirely, so the image processor is handed the
(ndarray, str)tuple rather than the frames. The same method is unpacked correctly at line 353.
Fix
Two call sites, matching what each callee actually returns:
read_videoand setmodality = "video"explicitly,which is exactly what
load_video(line 214) and the image-list branch (line 342) do.loglikelihooddoes not use.No behavior change on the
decordpath.Verification
Both failures are return-contract mismatches, so no GPU or model weights are needed.
load_video's return arity was read out of the file's own AST andread_video's from itssignature, then the unpacks were replayed:
ruff formatandruff checkat the version pinned in.pre-commit-config.yaml(v0.16.4),against the repo's
pyproject.toml: format clean, and the 17 pre-existing findings in thisfile are byte-for-byte unchanged by the patch.
Related: #1492 fixes the same copied-from-decord mistake in
llava_vid.py'spyavbranch.🤖 Generated with Claude Code