Skip to content

llama4 video support - #2942

Open
awasthiabhijeet wants to merge 1 commit into
meta-pytorch:mainfrom
awasthiabhijeet:export-D89577119
Open

llama4 video support#2942
awasthiabhijeet wants to merge 1 commit into
meta-pytorch:mainfrom
awasthiabhijeet:export-D89577119

Conversation

@awasthiabhijeet

Copy link
Copy Markdown

Summary:
Adds video processing support to the Llama4 model by extending the existing vision encoder infrastructure to handle video content. It introduces video-specific special tokens (<|video|>, <|vid_start|>, <|vid_end|>, <|vid_frame_separator|>) in the tokenizer, implements a new transform_video() method that processes video clips as sequences of frames through the existing image transform pipeline, and registers a "video" encoder in the EarlyFusionModel that reuses the vision encoder while maintaining separate tokenization paths for images and videos.

(Used HF implementation as a reference to ensure consistent changes in _tokenizer.py)

Differential Revision: D89577119

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 22, 2025
@meta-codesync

meta-codesync Bot commented Dec 22, 2025

Copy link
Copy Markdown

@awasthiabhijeet has exported this pull request. If you are a Meta employee, you can view the originating Diff in D89577119.

@meta-codesync

meta-codesync Bot commented Dec 22, 2025

Copy link
Copy Markdown

@awasthiabhijeet has imported this pull request. If you are a Meta employee, you can view this in D89577119.

Summary:
Adds video processing support to the Llama4 model by extending the existing vision encoder infrastructure to handle video content. It introduces video-specific special tokens (<|video|>, <|vid_start|>, <|vid_end|>, <|vid_frame_separator|>) in the tokenizer, implements a new transform_video() method that processes video clips as sequences of frames through the existing image transform pipeline, and registers a "video" encoder in the EarlyFusionModel that reuses the vision encoder while maintaining separate tokenization paths for images and videos.

(Used HF implementation as a reference to ensure consistent changes in _tokenizer.py)


Reviewed By: felipemello1

Differential Revision: D89577119

Pulled By: awasthiabhijeet
@meta-cla

meta-cla Bot commented Apr 25, 2026

Copy link
Copy Markdown

Hi @awasthiabhijeet!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants