WhisperX 语音转写
WhisperX 是推荐的、适合初学者的本地转写方案。
请在 TomoriBot 仓库根目录(也就是你克隆 TomoriBot 的那个文件夹)里运行这些命令。第一条命令会进入语音识别服务器文件夹:
Windows PowerShell
Section titled “Windows PowerShell”cd servers/sttpython -m venv .venv.\.venv\Scripts\Activate.ps1python -m pip install --upgrade pippip install -r requirements.txtpython whisperx_server.pyLinux/macOS Bash
Section titled “Linux/macOS Bash”cd servers/sttpython3 -m venv .venvsource .venv/bin/activatepython -m pip install --upgrade pippython -m pip install -r requirements.txtpython whisperx_server.py在 TomoriBot 使用 WhisperX 期间,请让那个终端保持打开。默认端点 URL 是 http://127.0.0.1:8021。
在 TomoriBot 中注册
Section titled “在 TomoriBot 中注册”运行 /providers,选择添加新自定义端点,并使用语音识别专用的 API 兼容性:
- API 兼容性:
openai-compatible-transcription endpoint_url:http://127.0.0.1:8021
保存连接后,选中它,并用它的模型下拉菜单把 large-v3(或者 WHISPERX_MODEL 所设的值)添加为语音识别模型。
端点注册和模型设置都在 /providers 里做,之后打开 /config > 模型 > 切换模型,选中并激活已注册的端点。
使用转写内容
Section titled “使用转写内容”注册之后,TomoriBot 会在后台转写音频附件,并把文字加入聊天上下文。只有当你还想把转写内容公开发到聊天里时,才需要用到 /config > 行为 > 提示。