Administrator
发布于 2024-07-17 / 84 阅读
0

语音转文本 whisper

1 whisper-webui

0,参考:

openai-whisper:https://github.com/openai/whisper
启动命令行参数:https://github.com/jhj0517/Whisper-WebUI/wiki/Command-Line-Arguments

whisper-webui:https://github.com/jhj0517/Whisper-WebUI?tab=readme-ov-file

faster-whisper:https://github.com/SYSTRAN/faster-whisper/tree/master?tab=readme-ov-file

在线示例(优化后的模型):https://huggingface.co/spaces/aadnk/faster-whisper-webui

在线示例:https://huggingface.co/spaces/aadnk/whisper-webui

1,安装

首先使用 conda 创建python版本为3.10的环境(文档要求3.8~3.10),否则版本不匹配安装失败

一定要先使用conda切到对应环境才行,如:conda activate whisper-webui

2,遇到的问题:

0 下载模型缓慢

-- 使用代理+国内镜像源地址

1 可能网络异常

-- 不要代理本地

2 默认启用127.0.0.1为地址;

--需要设置启动参数 vim start-webui.sh

3 运行模型时出现 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

-- 无环境变量,可以写在启动脚本中

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/whisper/whisper-webui/WebUI/venv/lib/python3.10/site-packages/nvidia/cudnn/lib

#!/bin/bash

PYTHON="./venv/bin/python"
echo "venv ${PYTHON}"
echo ""

# 设置环境变量,解决:Error: libcudnn_ops_infer.so.8: cannot open shared object file: No such file or directory
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/whisper/whisper-webui/WebUI/venv/lib/python3.10/site-packages/nvidia/cudnn/lib

$PYTHON ./app.py --server_name 10.143.138.188 --server_port 7863 --api_open True
#nohup $PYTHON -u ./app.py --server_name 10.143.138.188 --server_port 7863 --api_open True > output.log 2>&1 &

echo "launching the app"

4 faster-whisper是自行从https://huggingface.co/Systran/下载模型,下载很慢

-- 设置临时代理,仅当前ssh会话窗口生效

export http_proxy=http://10.143.138.16:7890
export https_proxy=http://10.143.138.16:7890
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple