#1335 ValueError: Cannot find a function with `api_name`: /gen_single.

2604:a840* Posted at: 12 hours ago 👁18

无效的值或参数:Cannot find a function with api_name: /gen_single.:
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 307, in _run
File "videotrans\tts\_f5tts.py", line 180, in _item_task_index
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: /gen_single.


=
system:Windows-10-10.0.19045-SP0
version:v3.83
frozen:True
language:zh
root_dir:D:/VideoTools/VideoTrans

3 Replies

这个错误表明您使用的 F5-TTS 配音服务接口发生了变化,导致软件无法找到正确的 API 端点 /gen_single

请按以下步骤解决:

  1. 更换配音渠道:这是最直接有效的解决方案。在软件主界面的“配音”设置中,暂时切换到其他可用的配音渠道,例如 Edge-TTSOpenAI TTS
  2. 检查服务状态:如果您使用的是自行部署的 F5-TTS 服务,请确认其服务地址是否正确,并且服务本身已更新至最新版本,API 路径可能已发生改变。
  3. 提供日志:如果问题持续存在且您需要进一步的技术分析,请提供完整的日志文件。日志位于软件根目录下的 logs 文件夹中(即 D:/VideoTools/VideoTrans/logs/),请将最新的日志文件内容贴出来。


Application started at 2025-11-05 17:16:43

2025-11-05 17:16:43,311 - INFO - 返回缓存的编解码器 Windows-264: libx264
self.proxy_str='http://127.0.0.1:7897'
2025-11-05 22:54:58,631 - INFO - 返回缓存的编解码器 Windows-264: libx264
2025-11-05 22:54:58,631 - INFO - 未找到或未选择硬件编码器,将使用软件编码。
self.proxy_str='http://127.0.0.1:7897'
2025-11-05 22:54:59,561 - INFO - 开始创建 pid:self.pidfile='D:/VideoTools/VideoTrans/tmp5372/6184.lock'
2025-11-05 22:55:05,858 - INFO - Processing audio with duration 00:08.452
2025-11-05 22:55:06,002 - INFO - VAD filter removed 00:01.380 of audio
2025-11-05 22:55:06,002 - DEBUG - VAD filter kept the following audio segments: [00:00.320 -> 00:00.672], [00:00.896 -> 00:02.944], [00:03.232 -> 00:04.672], [00:04.992 -> 00:08.224]
2025-11-05 22:55:06,014 - DEBUG - Processing segment at 00:00.000
self.proxy_str='http://127.0.0.1:7897'
self.proxy_str='http://127.0.0.1:7897'
self.proxy_str='http://127.0.0.1:7897'
self.proxy_str='http://127.0.0.1:7897'
2025-11-05 22:55:43,056 - INFO - 未找到或未选择硬件编码器,将使用软件编码。
2025-11-05 22:55:43,177 - INFO - 未找到或未选择硬件编码器,将使用软件编码。
self.proxy_str='http://127.0.0.1:7897'
2025-11-05 22:55:43,443 - INFO - 未找到或未选择硬件编码器,将使用软件编码。
2025-11-05 22:55:43,539 - INFO - 未找到或未选择硬件编码器,将使用软件编码。
2025-11-05 22:55:43,716 - INFO - 开始创建 pid:self.pidfile='D:/VideoTools/VideoTrans/tmp5372/14584.lock'
2025-11-05 22:55:49,692 - INFO - Processing audio with duration 00:06.229
2025-11-05 22:55:49,741 - INFO - VAD filter removed 00:01.653 of audio
2025-11-05 22:55:49,741 - DEBUG - VAD filter kept the following audio segments: [00:00.288 -> 00:02.400], [00:02.912 -> 00:03.296], [00:03.776 -> 00:05.856]
2025-11-05 22:55:49,746 - DEBUG - Processing segment at 00:00.000
self.proxy_str='http://127.0.0.1:7897'
2025-11-05 22:56:01,367 - INFO - 开始创建 pid:self.pidfile='D:/VideoTools/VideoTrans/tmp5372/14092.lock'
2025-11-05 22:56:05,619 - INFO - Processing audio with duration 00:09.636
2025-11-05 22:56:05,672 - INFO - VAD filter removed 00:02.208 of audio
2025-11-05 22:56:05,672 - DEBUG - VAD filter kept the following audio segments: [00:00.192 -> 00:00.896], [00:01.504 -> 00:02.176], [00:02.720 -> 00:03.840], [00:04.352 -> 00:06.432], [00:06.784 -> 00:09.636]
2025-11-05 22:56:05,677 - DEBUG - Processing segment at 00:00.000
self.proxy_str='http://127.0.0.1:7897'
2025-11-05 22:56:18,420 - INFO - 开始创建 pid:self.pidfile='D:/VideoTools/VideoTrans/tmp5372/14872.lock'
2025-11-05 22:56:24,818 - INFO - Processing audio with duration 00:06.224
2025-11-05 22:56:24,865 - INFO - VAD filter removed 00:01.712 of audio
2025-11-05 22:56:24,865 - DEBUG - VAD filter kept the following audio segments: [00:00.288 -> 00:02.400], [00:02.912 -> 00:03.264], [00:03.808 -> 00:05.856]
2025-11-05 22:56:24,869 - DEBUG - Processing segment at 00:00.000
self.proxy_str='http://127.0.0.1:7897'
2025-11-05 22:56:36,654 - INFO - 开始创建 pid:self.pidfile='D:/VideoTools/VideoTrans/tmp5372/14396.lock'
2025-11-05 22:56:41,854 - INFO - Processing audio with duration 00:04.352
2025-11-05 22:56:41,900 - INFO - VAD filter removed 00:00.544 of audio
2025-11-05 22:56:41,900 - DEBUG - VAD filter kept the following audio segments: [00:00.288 -> 00:01.664], [00:01.920 -> 00:04.352]
2025-11-05 22:56:41,904 - DEBUG - Processing segment at 00:00.000
TTS_TYPE_LIST[show_ttstype_name]=15
self.proxy_str='http://127.0.0.1:7897'
2025-11-05 23:02:35,139 - INFO - Starting call to 'videotrans.tts._f5tts.F5TTS._item_task.._run', this is the 1st time calling it.
ttstype='Index-TTS'
Loaded as API: http://127.0.0.1:7860/
2025-11-05 23:02:35,182 - INFO - index-tts data={'ref_wav': 'D:/VideoTools/VideoTrans/f5-tts/女主播.wav'}
2025-11-05 23:02:35,183 - INFO - Finished call to 'videotrans.tts._f5tts.F5TTS._item_task.._run' after 0.047(s), this was the 1st time calling it.
2025-11-05 23:02:40,186 - INFO - Starting call to 'videotrans.tts._f5tts.F5TTS._item_task.._run', this is the 2nd time calling it.
ttstype='Index-TTS'
Loaded as API: http://127.0.0.1:7860/
2025-11-05 23:02:40,241 - INFO - index-tts data={'ref_wav': 'D:/VideoTools/VideoTrans/f5-tts/女主播.wav'}
2025-11-05 23:02:40,241 - INFO - Finished call to 'videotrans.tts._f5tts.F5TTS._item_task.._run' after 5.109(s), this was the 2nd time calling it.

从日志可以看到,软件成功连接到了您本地部署的 F5-TTS 服务 (http://127.0.0.1:7860/),但在调用具体的 API 端点 /gen_single 时失败。这表明您部署的 F5-TTS 服务版本与软件当前版本不兼容,API 接口已发生变化。

请按以下步骤解决:

  1. 立即解决方案:在软件主界面的"配音"设置中,切换到其他可用的配音渠道,例如 Edge-TTSOpenAI TTS,以完成当前任务。
  2. 根本解决方案:如果您希望继续使用 F5-TTS,需要:

    • 确认您部署的 F5-TTS 是否为最新版本
    • 检查 F5-TTS 服务的 API 文档,确认正确的接口路径
    • 可能需要更新或重新部署 F5-TTS 服务
  3. 替代方案:考虑使用软件内置的其他本地 TTS 选项,或者配置稳定的在线 TTS 服务(如 Azure TTS、OpenAI TTS 等)。

由于这是第三方服务接口变更导致的问题,建议优先使用软件内置的其他配音选项。

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.

Donate: https://ko-fi.com/jianchang512

Trending Questions