Views
No views yet
[!Important] This is a pretrained model checkpoint without supervised instruction tuning (no offline SFT / no Real-Time SFT).

VideoMllamaTextCrossAttention mechanism, it achieves high-efficiency semantic alignment between temporal visual features and linguistic context.1import torch
2from transformers import AutoModelForCausalLM, AutoProcessor
3checkpoint = "OpenMOSS-Team/moss-video-preview-base"
4video_path = "data/example_video.mp4"
5prompt = "" # For base model, prompt is set to empty to perform completion task.
6
7processor = AutoProcessor.from_pretrained(
8 checkpoint,
9 trust_remote_code=True,
10 frame_extract_num_threads=1,
11)
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": "video"},
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 videos=[video_path],
34 video_fps=1.0,
35 video_minlen=8,
36 video_maxlen=16,
37 add_special_tokens=False,
38 return_tensors="pt",
39).to(model.device)
40
41with torch.no_grad():
42 output_ids = model.generate(**inputs, max_new_tokens=512, do_sample=False)
43
44print(processor.decode(output_ids[0], skip_special_tokens=True))
451import torch
2from PIL import Image
3from transformers import AutoModelForCausalLM, AutoProcessor
4checkpoint = "OpenMOSS-Team/moss-video-preview-base"
5image_path = "data/example_image.jpg"
6prompt = "" # For base model, prompt is set to empty to perform completion task.
7
8image = Image.open(image_path).convert("RGB")
9
10processor = AutoProcessor.from_pretrained(
11 checkpoint,
12 trust_remote_code=True,
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": "image"},
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 images=[image],
36 add_special_tokens=False,
37 return_tensors="pt",
38).to(model.device)
39
40with torch.no_grad():
41 output_ids = model.generate(**inputs, max_new_tokens=256, do_sample=False)
42
43print(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)README.md.auto_map in config.json.[!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}