分支标签打开更多操作菜单

最新提交

 

历史

1 次提交1 次提交

文件夹和文件

名称名称最后提交信息最后提交日期
.github/workflows.github/workflows  
assetsassets  
configsconfigs  
demodemo  
docsdocs  
duoduo  
examplesexamples  
teststests  
.gitattributes.gitattributes  
.gitignore.gitignore  
LICENSELICENSE  
README.mdREADME.md  
SECURITY.mdSECURITY.md  
pyproject.tomlpyproject.toml  
run_demo.pyrun_demo.py  

仓库文件导航

Duo:面向全双工交互的互惠世界模型

Homepage arXiv Hugging Face GitHub Technical Report License Python

vLLM-Omni · SGLang-Omni

Duo v1 是一个互惠世界模型,它将智能与物理现实视为对世界同等根本的存在。它持续感知音视频输入,同时实时作出回应,从而实现自然对话与打断。本次 预览版 目前支持基础的音视频对话,更新版本即将推出。 main 分支提供面向研究的离线管线,而 inference/vllm-omni-duo 和 inference/sglang-omni-duo 分支提供加速的在线实时流式管线。

🔥 新闻

✨ 架构

Duo v1 architecture with Intent and Realization modules

Duo 引入了三项关键技术设计:

  • 利用自回归建模进行持续的交互推理与参与决策,而不是将其局限于扩散模型的指令理解。
  • 构建分块特定的条件,并在统一时间线上同步 Intent 与 Realization 之间的 token。模块特定的注意力掩码在块内和跨块强制因果依赖,防止访问未来输入。
  • 通过双重 rollout 蒸馏缓解两个模块中的分布偏移,在自回归生成的 Intent token 和由 Realization 合成的音视频历史之上进行训练。

Duo v1 是面向研究者的预览版。在下面的离线管线中,用户视频和 ASR 文本经过 Intent,后者通过意图状态引导 Realization。Duo v2 即将推出,将直接以用户音频和视频为条件驱动 Realization,从而实现视觉交互。

completed user recording
    │
    ├─ Qwen3-ASR + forced alignment ─ user video/text chunks
    │                                      │
    └──────────────────────────────────── Intent
                                           │ intent states
                                           ▼
                                      Realization
                                           │ assistant media latents
                                           ▼
                                  streaming media codecs
                                           │
                                           ▼
                                  browser playback and API

参见 架构 了解因果可见性和清晰的承诺契约。

📦 模型发布

版本 因果基础模型 蒸馏 量化 特性 / 说明
v1.0 Duo-1.0-causal-base Duo-1.0-distill Duo-1.0-distill-quant 基础全双工实时音视频对话。
v1.2 Duo-1.2-causal-base 即将推出 即将推出 质量改进。
v2.0 即将推出 即将推出 即将推出 视觉交互。

🛠️ 环境要求

  • Linux 和 Python 3.10 或更高版本
  • FFmpeg 和 FFprobe 位于 PATH
  • CUDA GPU x2。默认离线配置将一个分配给 Intent/编解码器,一个分配给 Realization
  • 为所选已发布检查点提供足够的 GPU 内存
  • 参考离线部署使用独立的模型环境和语音环境,因为 qwen-asr 固定了其自身兼容的 Transformers 版本。

🚀 安装

克隆仓库并创建模型环境:

git clone https://github.com/inclusionAI/Duo.git
cd Duo
python -m venv .venv-model
source .venv-model/bin/activate
pip install --upgrade pip
# Install the PyTorch, TorchAudio, and TorchVision wheels matching your CUDA driver.
pip install -e '.[realization]'
deactivate

创建语音环境:

python -m venv .venv-speech
source .venv-speech/bin/activate
pip install --upgrade pip
# Install the PyTorch wheel matching your CUDA driver.
pip install -e '.[speech]'
deactivate

除了包版本之外,CUDA 构建标签也很重要。在可编辑安装之前,从与主机驱动匹配的索引安装 PyTorch。Pip 会保留已安装的兼容构建。可为目标 GPU 安装可选优化的注意力内核。 sdpa 是可移植的默认选项。

🤗 下载检查点

下载完整的 Duo-1.2-causal-base 包。它已包含离线推理所需的全部模型,包括语音识别和强制对齐:

hf download inclusionAI/Duo-1.2-causal-base --local-dir weights

要运行 1.0 蒸馏或量化的 Realization,请先下载 1.0 因果包,然后将选定的 Realization 权重覆盖到同一目录:

hf download inclusionAI/Duo-1.0-causal-base --local-dir weights
hf download inclusionAI/Duo-1.0-distill --local-dir weights
# Or: hf download inclusionAI/Duo-1.0-distill-quant --local-dir weights

要将包存储在其他位置,请更改 --local-dir 并更新 configs/inference.json中的模型路径。完整目录布局为:

weights/
├── realization/
│   ├── complete.json
│   ├── dcp/
│   │   ├── .metadata
│   │   └── *.distcp
│   └── backbone/                 # when referenced by complete.json
├── intent/                       # base Intent processor and model
├── intent_adapter/               # Intent tokenizer and adapter
│   └── protocol_manifest.json
├── codec/
│   ├── video_vae/model.safetensors
│   └── audio_vae/diffusion_pytorch_model.safetensors
└── speech/
    ├── recognizer/
    └── forced-aligner/

运行时在本地读取所有权重,启动时不下载模型。保持 realization_family 设置为 auto;清单为因果检查点选择 student ,为蒸馏检查点选择 realization 。发布清单还会选择经过验证的采样器默认值:因果基础模型使用 50 步 Euler 和 flow shift 1.0,蒸馏模型使用 4 步 Euler 和 flow shift 5.0。量化版本由可移植离线运行时反量化;优化的 FP8 执行由专用服务分支提供。

🎮 运行离线演示

复制并编辑示例配置:

cp configs/inference.example.json configs/inference.json

在以下文件中设置三个 Python 可执行文件: configs/inference.json典型配置如下:

{
  "executables": {
    "realization_python": ".venv-model/bin/python",
    "intent_python": ".venv-model/bin/python",
    "speech_python": ".venv-speech/bin/python",
    "ffmpeg": "ffmpeg",
    "ffprobe": "ffprobe"
  }
}

在同一文件中设置本地模型目录。接受绝对路径:

{
  "weights": {
    "realization": "/models/duo/realization",
    "realization_family": "auto",
    "intent": "/models/duo/intent",
    "intent_adapter": "/models/duo/intent_adapter",
    "intent_protocol": "/models/duo/intent_adapter/protocol_manifest.json",
    "codec": "/models/duo/codec",
    "speech_recognizer": "/models/speech/recognizer",
    "forced_aligner": "/models/speech/forced-aligner"
  }
}

使用你的配置启动演示:

.venv-model/bin/python run_demo.py --config configs/inference.json --port 4173

打开 http://127.0.0.1:4173/video/index.html,然后录制或上传 MP4/WebM 视频,以生成并播放 Duo 的音视频响应。如果部署在反向代理之后,请设置 DUO_PUBLIC_URL 在发布前访问公开演示 URL。你也可以在预览模式下探索界面,而无需加载模型权重。 预览模式 ,而无需加载模型权重。

Duo offline demo console showing video recording, playback, and inference progress

⚙️ 配置

configs/inference.example.json 控制可执行文件、权重位置、GPU 分配、分辨率、随机种子、采样器步数以及 Case 目录。相对路径从仓库根目录解析。运行时输出写入配置的运行时目录,该目录被 Git 忽略。

🗂️ 仓库布局

Duo/
├── configs/               # offline runtime and Case configuration
├── demo/                  # browser frontend
├── docs/                  # architecture and frontend integration notes
├── duo/
│   ├── data/              # inference sequence materialization
│   ├── inference_runtime/ # multi-GPU offline execution engine
│   ├── models/            # Intent, Realization, and codecs
│   ├── preprocessing/     # ASR, alignment, and user-video preparation
│   ├── runtime/           # distributed inference/checkpoint utilities
│   └── serving/           # HTTP API, sessions, media publication
├── tests/                 # CPU regression and release-safety tests
└── run_demo.py            # end-to-end offline launcher

🤗 致谢

我们感谢 MiniMax H3 以及 Qwen 团队提供模型和研究。我们也感谢 Hugging Face, vLLM (尤其是 vLLM-Omni)、以及 SGLang (尤其是 )社区。社区。

📝 引用

如果您在研究中使用 Duo,请引用:

@misc{cao2026duoreciprocalworldmodel,
  title         = {Duo: A Reciprocal World Model for Full-Duplex Interaction},
  author        = {Hengyuan Cao and Biao Gong and Guoshan Lu and Qiyuan Zhang and Lin Liu and Yiding Tian and Yilei Jiang and Yuxin Ma and Chengzhang Wu and Kun Chen and Yiqian Xie and Ting Liu and Xin Zheng and Xijun Gu and Tianren Ma and Jiancheng Pan and Chi Zhang and Xuzhe Zheng and Siyi Li and Zhenzhong Lan},
  year          = {2026},
  eprint        = {2611.15131},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CV},
  url           = {https://arxiv.org/abs/2611.15131}
}

📄 许可证

本项目基于 Apache 2.0 许可证第三方组件在其源代码旁保留原始声明和许可证。

关于

Duo:一种用于全双工交互的互惠世界模型

资源

自述文件Apache-2.0 许可证

安全策略

安全策略活动自定义属性

星标

2 星标

关注者

0 关注者

复刻

0 复刻报告仓库

版本发布

贡献者语言

贡献者

语言