#1490 本地一键部署WhisperX 网页版 + API,但是运行起来是cpu版本.....

52.68* Posted at: 5 hours ago 👁11

大佬写的“本地一键部署你的 WhisperX 网页版 + API,支持说话人分离”很好,可是我的电脑运行却是:2025-11-17 20:42:19,930 - INFO - 成功从 token.txt 文件中读取 Hugging Face 令牌。
2025-11-17 20:42:19,930 - INFO - 使用设备: cpu,计算类型: int8
2025-11-17 20:42:19,935 - INFO - FFmpeg 环境检查通过。
2025-11-17 20:42:19,935 - INFO - 正在尝试加载说话人分离模型...
2025-11-17 20:42:19,936 - ERROR - 严重错误: 说话人分离模型加载失败。此功能将被禁用。错误信息: module 'whisperx' has no attribute 'DiarizationPipeline'
2025-11-17 20:42:19,936 - INFO - 服务已启动,正在监听 http://127.0.0.1:9092
2025-11-17 20:42:19,942 - INFO - Serving on http://127.0.0.1:9092
这说明是CPU版本速度太慢了.....如何成为GPU版本的?

1 Replies

根据错误信息,您的问题有两个关键点:1. 模型运行在 CPU 上;2. WhisperX 的说话人分离功能因缺少 DiarizationPipeline 而失败。

核心解决方案:确保您的环境正确安装了支持 GPU 的 PyTorch 和兼容的 WhisperX 版本。

请按以下步骤操作:

  1. 确认 CUDA 环境

    • 打开命令提示符,输入 nvidia-smi 查看显卡驱动和 CUDA 版本。
    • 记下显示的 CUDA Version(例如 12.4)。
  2. 安装对应版本的 PyTorch(GPU版)

    • 访问 PyTorch 官网 (https://pytorch.org/get-started/locally/)。
    • 根据您的 CUDA 版本,选择对应的安装命令。例如,对于 CUDA 12.1,命令可能是:

      pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
    • 在您的部署项目环境中,先卸载现有的 torchpip uninstall torch,然后执行上述对应 CUDA 版本的安装命令。
  3. 解决说话人分离错误

    • 错误 module 'whisperx' has no attribute 'DiarizationPipeline' 表明您安装的 whisperx 版本过旧或与代码不兼容。
    • 尝试升级 whisperx 到最新版:pip install --upgrade whisperx
    • 如果问题依旧,该项目可能依赖一个特定的 whisperx 分支或版本,请查阅该部署项目的官方文档或 README,确认其要求的精确版本。
  4. 验证安装

    • 重新启动您的服务。
    • 查看启动日志,确认是否显示 使用设备: cuda

如果上述步骤无法解决,请提供您部署的项目的具体名称或仓库地址,以便获取更精确的版本依赖信息。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions