#5958 无效的值或参数:Cannot find a function with `api_name`: /basic_tts.:Traceback (most recent call last):

103.62* Posted at: 22 hours ago

无效的值或参数:Cannot find a function with api_name: /basic_tts.:
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 18, in run
File "videotrans\tts\__init__.py", line 309, in run
File "videotrans\tts\_base.py", line 177, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_f5tts.py", line 313, in _run
File "videotrans\tts\_f5tts.py", line 82, in _item_task_v1
File "gradio_client\client.py", line 475, in predict

self._infer_fn_index(api_name, fn_index)

File "gradio_client\client.py", line 831, in _infer_fn_index

raise ValueError(error_message)

ValueError: Cannot find a function with api_name: /basic_tts.


=
system:Windows-10-10.0.26200-SP0
version:v3.83
frozen:True
language:zh
root_dir:E:/win-videotrans-v3.83

1 Replies

该错误是由于 pyVideoTrans 调用 F5-TTS 服务时,使用的 API 函数名称 /basic_tts 与您部署的 F5-TTS 服务中实际提供的接口名称不匹配。

解决方案:

  1. 升级软件版本:您当前使用的是 v3.83,该版本对 F5-TTS 的适配存在已知问题。请下载最新版 pyVideoTrans(v4.06),新版已统一 API 函数名为 /tts,可自动兼容官方 F5-TTS。
  2. 检查 F5-TTS 服务:打开部署 F5-TTS 的网页(通常为 http://127.0.0.1:7860),点击底部的 API 选项卡,查看可用端点列表。确认是否存在 /basic_tts/tts 或其他名称。若使用官方 Gradio 脚本,默认端点应为 /tts
  3. 临时绕过(不推荐):若无法升级,可在 pyVideoTrans 的 菜单 -> TTS 设置 -> F5-TTS 中,找到“API 函数名”选项(旧版可能无此选项),将其改为 /tts。若无此选项,需直接修改源码 videotrans/tts/_f5tts.py 中的 api_name 参数(不建议)。
  4. 确认服务已启动:确保 F5-TTS 服务已经完整启动且无报错,再在 pyVideoTrans 中执行配音。

请查阅相关文档:

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.

Dondate via ko-fi.com

Dondate via PayPal

Related resource