#7842 配音阶段出错 [Index-TTS(本地API)] Cannot find a function with `api_name`: /gen_single.Traceback (most recent call last):

107.155**7 Posted at: 1 hour ago

配音阶段出错 [Index-TTS(本地API)] Cannot find a function with api_name: /gen_single.
Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 156, in process_task

File "videotrans\task\dubbing.py", line 56, in dubbing

File "videotrans\task\dubbing.py", line 210, in _tts

File "videotrans\tts\__init__.py", line 232, in run

File "videotrans\tts\_base.py", line 137, 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.
[DubbingSrt]语音合成: self.out_ext='m4a',self.is_multi_role=True
[TaskCfgTTS]
原始输入文件名: F:/下载好的视频/新网球王子 U-17.srt,
输出结果保存到文件夹: F:/视频配音/output/tts,
临时文件夹: F:/sppy/tmp/23504/eb3ec241eb
未启用CUDA加速
配音渠道:Index-TTS(本地API), 角色:쏟아져 나오는 중국의 로봇! [코너별 다시보기 - 0921].ae-0-5.4.wav, 配音语言:zh-cn
音量:+0%, 语速:+0%, 未选 音频加速
未选 移除字幕间空隙, 未选 强制对齐字幕和声音
代理地址:http://127.0.0.1:7897


=
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 1 hour ago

这是由于 [Index-TTS(本地API)] 所连接的 Gradio 服务中不存在 /gen_single 这个 API 接口。/gen_single 是 Index-TTS 2.5 版本的接口名称,你部署的 Index-TTS 版本不同(或 UI 有变更),接口名已改变,导致软件按固定名称调用失败。

解决方案:

  1. 确认你部署的 Index-TTS 是否已正确启动,并能在浏览器中打开其 WebUI 页面。
  2. 在 WebUI 页面滚动到底部,点击右下角 Use via API(或 通过API使用),进入 API 说明页面。
  3. 找到负责生成克隆音频的那个接口,拉到接口说明最下方,找到 API name 对应值(如 /gen_single 可能已更名为其他名称)。
  4. 在软件根目录(sp.exe 所在文件夹)新建或编辑 gradio_api.txt 文件,按如下格式填写(api_name 改为你实际查到的接口名):
emo_control_method=Same as the voice reference
prompt=tts_audio
text=tts_text
lang_choice=ZH
emo_ref_path=tts_audio
api_name=你实际查到的接口名
  1. 保存后重启软件,重新执行配音。
注意:如果你直接使用的是软件内置的 Index-TTS 配音渠道,则无需创建 gradio_api.txt;gradio_api.txt 仅在通过 自定义TTS API 渠道对接自部署 Gradio WebUI 时使用。请确认你选择的是哪个渠道。

请查阅相关文档:

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