VibeVoice-ASR 是微软推出的统一语音转文本模型,支持单次处理长达 60 分钟 的长音频,可生成包含 说话人(Who)、时间戳(When)和内容(What) 的结构化转录文本,并支持自定义热词及超过 50 种语言。
| 特性 | 说明 |
|---|---|
| 🕒 60 分钟单次处理 | 64K token 上下文,支持长音频完整转录 |
| 👤 自定义热词 | 指定领域术语提升识别准确率 |
| 📝 丰富转录信息 | 同时输出说话人、时间戳、文本内容 |
| 🌍 多语言支持 | 超过 50 种语言,原生支持语码转换 |
| 组件 | 版本 |
|---|---|
| torch | ≥ 2.5.0 |
| torch-npu | ≥ 2.5.0 |
| transformers | ≥ 4.47.0 |
| CANN | 8.5.1+ |
| NPU | Ascend 910B / 910B4 |
| Python | 3.10+ |
# 1. 安装 torch 和 torch_npu(根据 CANN 版本选择)
pip install torch torch-npu --index-url https://download.pytorch.org/whl/npu
# 2. 安装 VibeVoice 源码
git clone https://github.com/microsoft/VibeVoice.git
cd VibeVoice
pip install -e .
# 3. 安装其他依赖
cd /path/to/VibeVoice-ASR
pip install -r requirements.txt
# 4. 验证 NPU 可用
python -c "import torch; import torch_npu; print(f'NPU available: {torch.npu.is_available()}')"# 方式一:从 HuggingFace 下载
pip install huggingface-hub
huggingface-cli download microsoft/VibeVoice-ASR --local-dir ./models/VibeVoice-ASR
# 方式二:从 GitCode 镜像下载(国内推荐)
git clone https://ai.gitcode.com/hf_mirrors/microsoft/VibeVoice-ASR ./models/VibeVoice-ASR
# 方式三:从 AtomGit 镜像下载
git clone https://ai.atomgit.com/ohhoohho/VibeVoice-ASR ./models/VibeVoice-ASR单条音频推理:
python inference.py --mode torch \
--model ./models/VibeVoice-ASR \
--device npu:0 \
--audio sample.wav批量推理:
python inference.py --mode torch \
--model ./models/VibeVoice-ASR \
--device npu:0 \
--audio_dir ./audio/ \
--output_dir ./results/指定热词和语言:
python inference.py --mode torch \
--audio sample.wav \
--hotwords 深度学习 人工智能 昇腾 \
--language zh启动服务端:
python inference.py --mode vllm \
--model ./models/VibeVoice-ASR \
--device npu:0 \
--serve \
--port 8000客户端调用:
python inference.py --mode vllm \
--audio sample.wav \
--api_url http://localhost:8000或使用 curl:
# 先 base64 编码音频
AUDIO_B64=$(base64 -w0 sample.wav)
curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "microsoft/VibeVoice-ASR",
"messages": [
{
"role": "user",
"content": [
{"type": "audio_url", "audio_url": {"url": "data:audio/wav;base64,'"$AUDIO_B64"'"}},
{"type": "text", "text": "Transcribe the audio."}
]
}
],
"max_tokens": 4096,
"temperature": 0
}' | python -m json.toolVibeVoice-ASR/
├── inference.py # 推理脚本(支持 PyTorch 和 vLLM-Ascend 两种模式)
├── README.md # 部署说明文档(本文件)
├── requirements.txt # 环境依赖清单
└── assets/ # 截图素材文件夹
├── agent_workflow.png # 部署流程图
├── npu_device_call.png # NPU 设备调用验证截图
└── model_result.png # 模型推理结果截图sample.wav[Speaker 0] 0.00s - 3.50s: Hello, welcome to our presentation today.
[Speaker 1] 3.52s - 7.80s: Thank you. I'm excited to share our latest findings.
[Speaker 0] 7.82s - 11.20s: Could you tell us more about the methodology?
[Speaker 1] 11.22s - 15.00s: Sure. We used a transformer-based approach with continuous speech tokenization.| 指标 | 数值 |
|---|---|
| 余弦相似度 | 待验证 |
| 精度误差 | 待验证 |
| 是否满足要求 | 待验证 |
精度验证需在 GPU 和 NPU 上分别运行同一段音频,比较转录结果的余弦相似度。
| 指标 | 数值 |
|---|---|
| 平均延迟(30s 音频) | 待测 |
| 峰值显存 | 待测 |
| RTF(实时因子) | 待测 |
本项目基于 MIT 许可证授权。VibeVoice-ASR 模型本身使用 MIT 许可证。