Views
No views yet
[!Important] This is an offline SFT checkpoint (instruction-tuned). It is not the Real-Time SFT streaming checkpoint.

1import torch
2from transformers import AutoModelForCausalLM, AutoProcessor
3
4# Use Hugging Face model id (or load from a local folder with the same name).
5checkpoint = "OpenMOSS-Team/moss-video-preview-sft"
6video_path = "data/example_video.mp4"
7prompt = "Describe the video."
8
9processor = AutoProcessor.from_pretrained(
10 checkpoint,
11 trust_remote_code=True,
12 frame_extract_num_threads=1,
13)
14model = AutoModelForCausalLM.from_pretrained(
15 checkpoint,
16 trust_remote_code=True,
17 device_map="auto",
18 torch_dtype=torch.bfloat16,
19 attn_implementation="flash_attention_2",
20)
21
22messages = [
23 {
24 "role": "user",
25 "content": [
26 {"type": "video"},
27 {"type": "text", "text": prompt},
28 ],
29 }
30]
31
32input_text = processor.apply_chat_template(messages, add_generation_prompt=True)
33inputs = processor(
34 text=input_text,
35 videos=[video_path],
36 video_fps=1.0,
37 video_minlen=8,
38 video_maxlen=16,
39 add_special_tokens=False,
40 return_tensors="pt",
41).to(model.device)
42
43with torch.no_grad():
44 output_ids = model.generate(**inputs, max_new_tokens=512, do_sample=False)
45
46print(processor.decode(output_ids[0], skip_special_tokens=True))1import torch
2from PIL import Image
3from transformers import AutoModelForCausalLM, AutoProcessor
4
5checkpoint = "OpenMOSS-Team/moss-video-preview-sft"
6image_path = "data/example_image.jpg"
7prompt = "Describe this image."
8
9image = Image.open(image_path).convert("RGB")
10
11processor = AutoProcessor.from_pretrained(checkpoint, trust_remote_code=True)
12model = AutoModelForCausalLM.from_pretrained(
13 checkpoint,
14 trust_remote_code=True,
15 device_map="auto",
16 torch_dtype=torch.bfloat16,
17 attn_implementation="flash_attention_2",
18)
19
20messages = [
21 {
22 "role": "user",
23 "content": [
24 {"type": "image"},
25 {"type": "text", "text": prompt},
26 ],
27 }
28]
29
30input_text = processor.apply_chat_template(messages, add_generation_prompt=True)
31inputs = processor(
32 text=input_text,
33 images=[image],
34 add_special_tokens=False,
35 return_tensors="pt",
36).to(model.device)
37
38with torch.no_grad():
39 output_ids = model.generate(**inputs, max_new_tokens=256, do_sample=False)
40
41print(processor.decode(output_ids[0], skip_special_tokens=True))trust_remote_code=True for this model family (due to auto_map custom code)attn_implementation="flash_attention_2")cv2); offline demo relies on the processor's video loading backendREADME.md.[!IMPORTANT]🌟 Our Mission & Community Invitation
We have filled the gap in cross-attention-based foundation models for video understanding.We warmly welcome experts in Representation Learning and Model Efficiency to explore, experiment, and innovate on top of our architecture. Let's push the boundaries of video intelligence and advance the open-source community together!
1@article{wang2026mossvideo,
2 title = {{MOSS-Video-Preview: Toward Real-Time Video Understanding via Cross-Attention}},
3 author = {Pengyu Wang, Chenkun Tan, Shaojun Zhou, Wei Huang, Qirui Zhou, Zhan Huang, Zhen Ye, Jijun Cheng, Xiaomeng Qian, Yanxin Chen, Xingyang He, Huazheng Zeng, Chenghao Wang, Pengfei Wang, Hongkai Wang, Shanqing Gao, Yixian Tian, Chenghao Liu, Xinghao Wang, Botian Jiang, Xipeng Qiu},
4 year = {2026},
5 journal = {arXiv preprint arXiv:2606.07639},
6 eprint = {2606.07639},
7 archivePrefix = {arXiv},
8 primaryClass = {cs.CV},
9 url = {https://arxiv.org/abs/2606.07639}
10}