This repo contains code for our ICCV 2025 paper Vamba, a hybrid Mamba-Transformer model that leverages cross-attention layers and Mamba-2 blocks for efficient hour-long video understanding.
🌐 Homepage | 📖 arXiv | 💻 GitHub | 🤗 Model
Install
Please use the following commands to install the required packages:
conda env create -f environment.yaml conda activate vamba pip install flash-attn --no-build-isolation
Model Inference
"# git clone https://github.com/TIGER-AI-Lab/Vamba
# cd Vamba
# export PYTHONPATH=.
from tools.vamba_chat import Vamba
model = Vamba(model_path="TIGER-Lab/Vamba-Qwen2-VL-7B", device="cuda")
test_input = [
{
"type": "video",
"content": "assets/magic.mp4",
"metadata": {
"video_num_frames": 128,
"video_sample_type": "middle",
"img_longest_edge": 640,
"img_shortest_edge": 256,
}
},
{
"type": "text",
"content": "