跳转至

VibeVoice-ASR-Streaming

VibeVoice-ASR-Streaming 会在音频持续输入的过程中进行转录,而不是等待音频结束。它每收到一个音频块就输出一次文本,因此说话者讲话时就会实时生成转录文本。

非流式: VibeVoice-ASR
vLLM: vLLM-asr-streaming

安装

我们建议使用 NVIDIA Deep Learning Container 来管理 CUDA 环境。

  1. 启动 docker

    # NVIDIA PyTorch Container 24.07 ~ 25.12 verified. 
    # Previous versions are also compatible.
    sudo docker run --privileged --net=host --ipc=host --ulimit memlock=-1:-1 --ulimit stack=-1:-1 --gpus all --rm -it  nvcr.io/nvidia/pytorch:25.12-py3
    
    ## If flash attention is not included in your docker environment, you need to install it manually
    ## Refer to https://github.com/Dao-AILab/flash-attention for installation instructions
    # pip install flash-attn --no-build-isolation
    

  2. 从 GitHub 安装

    git clone https://github.com/microsoft/VibeVoice.git
    cd VibeVoice
    
    pip install -e .
    

  3. 安装 ffmpeg,以下两种用法都需要它来解码音频

    apt update && apt install ffmpeg -y
    

用法

用法 1:启动 FastAPI 演示

python demo/vibevoice_asr_streaming_fastapi_demo.py --model_path [add the checkpoint path here]

打开 http://localhost:7870,然后通过麦克风录音或选择文件。页面会在整个录音期间保持一个 WebSocket 连接,因此您还在说话时,文本就会实时出现。

用法 2:直接从文件进行推理

python demo/vibevoice_asr_streaming_inference_from_file.py --model_path [add the checkpoint path here] --audio_files [add an audio path here]

模型每输出一个数据块,就会立即打印。添加 --context_info "Microsoft,VibeVoice" 可以让识别偏向特定术语,其方式与非流式模型上的热词功能相同。

chunk 和 lookahead 参数从检查点的 preprocessor_config.json 中读取,因此检查点总是以其训练时使用的 chunk 大小运行。

📄 许可证

本项目基于 MIT License 许可。

本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 vib/VibeVoice