faster-whisper通过CTranslate2 转换的快速whisper推理服务

faster-whisper 通过CTranslate2 对于openai/whisper的tranformer 模型进行了转换,可以提示推理速度,同时还可以进行不同精度的配置
官方目前的测试是有4倍左右的提升,同时可以更好的支持使用cpu 进行推理,同时faster-whisper 可以兼容distil-whisper

运行问题

  • Could not load library libcudnn_ops_infer.so.8. Error: libcudnn_ops_infer.so.8: cannot open shared object file: No such file or directory
    实际此问题官方也有介绍,可以通过pip 安装cudnn 或者通过dnf 安装
# pip 模式
pip install nvidia-cublas-cu12 nvidia-cudnn-cu12
# dnf 模式
dnf install -y libcudnn8.x86_64

说明

对于使用openai/whisper 进行语音转文字的业务场景faster-whisper 是值得选择的框架

参考资料

https://github.com/SYSTRAN/faster-whisper
https://github.com/OpenNMT/CTranslate2/
https://github.com/Vaibhavs10/insanely-fast-whisper

posted on 2024-08-22 07:47  荣锋亮  阅读(10)  评论(0编辑  收藏  举报

导航