#7553 Cannot find a function with `api_name`: /gen_single.:{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'zh_female_tw.wav',

183.167**3 Posted at: 2 hours ago

Cannot find a function with api_name: /gen_single.:
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'zh_female_tw.wav', 'filename': 'F:/sppy/tmp/29012/1790072882.0968297-12.wav', 'tts_type': 12}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 232, in run
File "videotrans\tts\_base.py", line 124, in run
File "videotrans\tts\_base.py", line 212, in _item_task
File "videotrans\tts\_index.py", line 40, in _run
File "videotrans\tts\_gradio.py", line 53, in _send
File "gradio_client\client.py", line 496, in predict
File "gradio_client\client.py", line 542, in submit
File "gradio_client\client.py", line 880, in _infer_fn_index
ValueError: Cannot find a function with api_name: /gen_single.


=
system:Windows-10-10.0.22631-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:F:/sppy

1 Replies

#1 DeepSeek reply at 2 hours ago

原因是您部署的 Index-TTS WebUI 中不存在名为 /gen_single 的 API 端点,或该 WebUI 未开启 API 功能,导致 gradio_client 无法匹配到对应接口。

排查与解决:

  1. 用浏览器打开您的 Index-TTS WebUI 页面,拉到最底部,确认是否存在 Use via API / 通过API使用 字样。

    若没有,说明该 WebUI 启动时禁用了 API,需要在其启动脚本中开启 enable_api(可把该 webui.py 发给 AI 让其帮忙开启)。

  2. 点击 Use via API,在接口列表中确认真正用于语音克隆的 api_name,不同 Index-TTS 版本名称可能不同(例如 /gen_single/gen_single_audio 等)。

  3. 检查您软件根目录(本次为 F:/sppy)下是否存在 gradio_api.txt

    • 若使用 Index-TTS 2.5 官方 WebUI,该文件应填写:

      emo_control_method=Same as the voice reference
      prompt=tts_audio
      text=tts_text
      lang_choice=ZH
      emo_ref_path=tts_audio
      api_name=/gen_single
    • 若您实际 WebUI 的 api_name 不是 /gen_single,请把上面最后一行的值改成实际值。

  4. 同时确认软件顶部菜单 设置 -> TTS设置 -> 自定义TTS API 中填写的地址与正在运行的 WebUI 地址端口一致(例如 http://127.0.0.1:7860/)。

  5. 保存后重启软件再试。

若 Index-TTS 是官方标准版本,建议直接在配音渠道中选择内置的 Index-TTS(渠道索引 12 已原生支持),无需通过自定义 Gradio API 对接。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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

Related resource