#7841 Cannot find a function with `api_name`: /gen_single.:{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '+0%', 'role': '쏟아져

107.155**7 Posted at: 2 hours ago

Cannot find a function with api_name: /gen_single.:
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '+0%', 'role': '쏟아져 나오는 중국의 로봇! [코너별 다시보기 - 0921].ae-0-5.4.wav', 'filename': 'C:\Users\windos\AppData\Local\Temp/pyvideotrans/12-1791276227.9696233.wav', 'tts_type': 12, 'language': 'zh-cn', 'volume': '+0%', 'pitch': '+0Hz'}
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/Gradio)暴露的 API 端点名称已发生变化,不再叫 /gen_single,因此 gradio_api.txt 中配置的 api_name=/gen_single 无法匹配到对应函数,导致报错 Cannot find a function with api_name: /gen_single。

解决方案(按步骤执行):

  1. 确认 API 端点名称

    • 浏览器打开您正在运行的 Index-TTS WebUI 页面,拉到最底部,点击 Use via API(或 通过API使用)。
    • 在 API 文档中找到负责语音克隆/单句生成的那个接口。
    • 将该接口对应的 API name(形如 /xxx_xxx)记录下来。新版 Index-TTS 端点可能已改名,请以实际页面显示的为准。
  2. 修改配置文件

    • 进入软件根目录 F:/sppy,打开 gradio_api.txt。
    • 将其中 api_name=/gen_single 一行改为你上一步查到的真实端点,例如 api_name=/gen_single_tts(仅为示例,务必以实际为准)。
  3. 保存并重启软件后再试

    • 保存 gradio_api.txt 后重新启动 pyVideoTrans,再进行试听或配音。

如果您的 Index-TTS 并未自行封装 WebUI,而是直接使用软件内置的 Index-TTS 配音渠道,则不应手动创建 gradio_api.txt 走 Gradio 对接方式,请直接在主界面配音渠道中选择 Index-TTS 并确认其本地服务(默认 7860 端口)已正确启动。

若按上述修改后仍报同样的 Cannot find a function with api_name 错误,请提供 Index-TTS WebUI 底部 Use via API 页面中所有接口的 API name 截图或文本,以便进一步确认。

请查阅相关文档:

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