Video-Text-to-Text
Transformers
Safetensors
English
Chinese
qwen3_5
feature-extraction
wemm
multimodal
video
audio
quantized
fp8
custom_code
Instructions to use tencent/WeMM-Video-9B-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/WeMM-Video-9B-FP8 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("tencent/WeMM-Video-9B-FP8", trust_remote_code=True) model = AutoModel.from_pretrained("tencent/WeMM-Video-9B-FP8", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from tencent/WeMM-Video-9B-FP8: direct link, hf CLI and curl.
- Browser
- Download file 8.74 kB
-
https://huggingface.co/tencent/WeMM-Video-9B-FP8/resolve/main/README.md
- Command line
-
hf download hf://tencent/WeMM-Video-9B-FP8/README.md
-
curl -L -o README.md https://huggingface.co/tencent/WeMM-Video-9B-FP8/resolve/main/README.md
8.74 kB
| license: apache-2.0 | |
| language: | |
| - en | |
| - zh | |
| pipeline_tag: video-text-to-text | |
| library_name: transformers | |
| base_model: tencent/WeMM-Video-9B | |
| base_model_relation: quantized | |
| tags: | |
| - wemm | |
| - multimodal | |
| - video | |
| - audio | |
| - quantized | |
| - fp8 | |
| # WeMM-Video-9B · FP8 Block128 | |
| [](https://huggingface.co/collections/tencent/wemm-video) [](https://arxiv.org/abs/2611.26409) [](https://github.com/Tencent/WeMM-Video) [](https://huggingface.co/papers/2611.26409) | |
| ## Overview | |
| This repository contains the **FP8 Block128** Safetensors variant of [WeMM-Video-9B](https://huggingface.co/tencent/WeMM-Video-9B). WeMM-Video is a Chinese–English bilingual family for joint audio-visual understanding and reasoning. It accepts text, images, audio, and video and generates text responses. | |
| - **Weights** · 13.10 GiB of weight files | |
| - **Runtime** · patched vLLM 0.18.0 on a GPU with FP8 support | |
| ### Capabilities | |
| WeMM-Video can combine video frames with the original soundtrack to describe events, transcribe speech, and reason about what is seen and heard. It also accepts silent video, standalone audio, images, and text, with responses in Chinese or English. | |
| <p align="center"> | |
| <img src="./wemm-video-capabilities-compact.png" width="90%" alt="Examples of WeMM-Video understanding and reasoning across audio-visual, audio, image, and text inputs."> | |
| </p> | |
| ### Architecture and training | |
| Vision and audio encoders turn media into tokens that the language model processes alongside text. Video frames carry timestamps. The family was pretrained on approximately 1.2 trillion multimodal tokens, then post-trained with multi-teacher OPD, anti-repetition MrDPO, and specialist reinforcement learning. | |
| <p align="center"> | |
| <img src="./wemm-video-architecture.png" width="75%" alt="WeMM-Video architecture with separate vision and audio encoders feeding media tokens to the language model."> | |
| </p> | |
| See the [project overview](https://github.com/Tencent/WeMM-Video#overview) for family details. | |
| ## Quantization | |
| Selected language linear weights use E4M3FN FP8 in 128 × 128 blocks with dynamic per-token activation scaling in groups of 128. The media encoders and protected language tensors retain their source precision. See the [quantization manifest](quantization_manifest.json) for tensor scope and export checks. | |
| ## Direct loading with Transformers | |
| Use the [Transformers environment](https://github.com/Tencent/WeMM-Video#install-dependencies). The local release checkpoint passed full weight loading and generation on one NVIDIA L20 with Transformers 5.2.0 and PyTorch 2.10.0+cu129. Generation checks covered text, image, audio, video frames, and video with its soundtrack. The same loader accepts the model's Hub ID. The validation used local checkpoint files. | |
| The loaded model retains FP8 weights in the quantized layers. | |
| ```python | |
| import torch | |
| from transformers import AutoModelForImageTextToText, AutoProcessor | |
| model_id = "tencent/WeMM-Video-9B-FP8" | |
| processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True) | |
| model = AutoModelForImageTextToText.from_pretrained( | |
| model_id, trust_remote_code=True, dtype=torch.bfloat16, | |
| device_map="cuda:0", | |
| ).eval() | |
| messages = [{"role": "user", "content": [ | |
| {"type": "text", "text": "What is 2 + 2? Reply with the number only."}, | |
| ]}] | |
| inputs = processor.apply_chat_template( | |
| messages, tokenize=True, return_dict=True, return_tensors="pt", | |
| add_generation_prompt=True, enable_thinking=False, | |
| ).to(device=model.get_input_embeddings().weight.device, dtype=torch.bfloat16) | |
| with torch.inference_mode(): | |
| output = model.generate(**inputs, do_sample=False, max_new_tokens=32) | |
| print(processor.tokenizer.decode(output[0, inputs.input_ids.shape[1]:], skip_special_tokens=True)) | |
| ``` | |
| ### Transformers input types | |
| For a media request, place the media item before the text item in `messages[0]["content"]` and run the same preprocessing and generation. | |
| | Input | Example content item | | |
| | --- | --- | | |
| | Text | `{"type": "text", "text": "Describe what you see."}` | | |
| | Image | `{"type": "image", "image": "image.jpg"}` | | |
| | Audio | `{"type": "audio", "audio": "speech.wav"}` | | |
| | Video frames | `{"type": "video", "video": "clip.mp4"}` | | |
| | Video with soundtrack | `{"type": "video_audio", "video": "clip.mp4"}` | | |
| See the [Transformers examples](https://github.com/Tencent/WeMM-Video#load-from-hugging-face-with-transformers) for media decoding dependencies and sampling options. | |
| ## Serving | |
| Install the [matching WeMM runtime patch](https://github.com/Tencent/WeMM-Video/blob/main/patch/README.md#manual-install-and-patch). The [serving guide](https://github.com/Tencent/WeMM-Video/blob/main/docs/serving.md#runtime-profiles) lists the dependency profiles and Docker images. Choose one server below. | |
| ### vLLM | |
| Use patched vLLM 0.18.0 on a GPU with FP8 support. See the [vLLM recipe](https://github.com/Tencent/WeMM-Video/blob/main/docs/serving.md#serve-with-vllm) for setup details. | |
| ```bash | |
| MODEL=tencent/WeMM-Video-9B-FP8 | |
| vllm serve "$MODEL" --served-model-name "$MODEL" --trust-remote-code --dtype bfloat16 \ | |
| --host 127.0.0.1 --port 8000 --max-model-len 8192 \ | |
| --no-enable-prefix-caching --mamba-ssm-cache-dtype float32 \ | |
| --limit-mm-per-prompt '{"image":4,"video":2,"audio":2}' \ | |
| --media-io-kwargs '{"video":{"fps":2,"min_frames":4,"max_frames":16,"total_pixels":262144}}' | |
| ``` | |
| ### Input examples for the serving API | |
| With the server running on port 8000, use the bundled request client from the project root in a second terminal. It sends media inline to the OpenAI-compatible chat endpoint. | |
| ```bash | |
| MODEL=tencent/WeMM-Video-9B-FP8 | |
| python examples/chat.py text --model "$MODEL" | |
| python examples/chat.py image --model "$MODEL" | |
| python examples/chat.py audio --model "$MODEL" | |
| python examples/chat.py video --model "$MODEL" | |
| python examples/chat.py video-audio --model "$MODEL" | |
| ``` | |
| | Input | Request content | | |
| | --- | --- | | |
| | Text | Text string in `messages[].content` | | |
| | Image | `image_url` with `image_url.url` | | |
| | Audio | `audio_url` with `audio_url.url` | | |
| | Video frames | `video_url` with `video_url.use_audio` set to `false` | | |
| | Video with soundtrack | `video_url` with `video_url.use_audio` set to `true` | | |
| Set `fps` and `max_frames` inside `video_url` to control sampling for a clip. Set `chat_template_kwargs.enable_thinking` to `true` for Thinking mode. See the [complete video request](https://github.com/Tencent/WeMM-Video/blob/main/docs/serving.md#send-a-video-request). | |
| ## Chat Modes | |
| The checkpoint template defaults to Instruct. Set `enable_thinking=True` through the runtime's chat-template options to use Thinking mode. Use the media processor and chat template shipped with this checkpoint. | |
| ## Recommended Sampling Parameters | |
| | Mode | Task | `temperature` | `top_p` | `top_k` | `presence_penalty` | `repetition_penalty` | | |
| | --- | --- | ---: | ---: | ---: | ---: | ---: | | |
| | Thinking | Silent video and audio-visual video | 0.6 | 0.95 | 20 | 1.5 | 1.0 | | |
| | Thinking | Image and text | 1.0 | 0.95 | 20 | 1.5 | 1.0 | | |
| | Thinking | Audio only | 0.9 | 0.95 | 20 | 1.5 | 1.0 | | |
| | Instruct | General tasks | 1.0 | 0.95 | 20 | 1.5 | 1.0 | | |
| For Transformers, set `do_sample=True` and pass `temperature`, `top_p`, `top_k`, and `repetition_penalty` to `generate()`. Apply `presence_penalty` in a runtime that exposes it, such as vLLM. | |
| ## Validation | |
| Patched vLLM loaded the checkpoint on H20 and completed generation checks for text, image, audio, and video with a soundtrack. The runtime precision audit confirmed the W8A8 path. | |
| ## Evaluation | |
| See the [WeMM-Video-35B-A3B evaluation results](https://huggingface.co/tencent/WeMM-Video-35BA3B#evaluation) for the benchmark comparison in the technical report. | |
| ## License | |
| Apache License 2.0. See the [included license](LICENSE) and the [collection license and third-party attribution](https://github.com/Tencent/WeMM-Video/blob/main/LICENSE). Third-party components remain subject to their original terms. | |
| ## Citation | |
| ```bibtex | |
| @misc{WeMM-Video, | |
| title={WeMM-Video: Pushing the Frontiers of Open-Source Omni-Modal Video Understanding}, | |
| author={Changli Tang and Jie Yang and Tianyi Wang and Lei Li and Daoze Zhang and Zijie Xin and Zhan Liu and Li Li and Jinchang Xu and Fengyun Rao and Chao Zhang and Jing Lyu}, | |
| year={2026}, | |
| eprint={2611.26409}, | |
| archivePrefix={arXiv}, | |
| primaryClass={cs.CV}, | |
| url={https://arxiv.org/abs/2611.26409}, | |
| } | |
| ``` | |