#8852 Index-TTS(本地API): index 该渠道需另行部署并启动后可用self.api_url='http://127.0.0.1:7860'

116.141**4 Posted at: 11 hours ago

Index-TTS(本地API): index 该渠道需另行部署并启动后可用
self.api_url='http://127.0.0.1:7860'
Could not get Gradio config from: http://127.0.0.1:7860/

{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'en_female_2.wav', 'filename': 'D:/TK/win-pyvideotrans-v4.19/tmp/6348/1795080053.028009-13.wav', 'tts_type': 13}
Traceback (most recent call last):
File "gradio_client\client.py", line 975, in _get_config
AttributeError: 'NoneType' object has no attribute 'group'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\tts\_gradio.py", line 52, in _send
File "videotrans\tts\_gradio.py", line 37, in get_thread_client
File "gradio_client\client.py", line 162, in init
File "gradio_client\client.py", line 977, in _get_config
ValueError: Could not get Gradio config from: http://127.0.0.1:7860/

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 23, in run
File "videotrans\tts\__init__.py", line 154, in run
File "videotrans\tts\_base.py", line 98, in run
File "videotrans\tts\_base.py", line 201, in _exec
File "videotrans\tts\_base.py", line 161, in _local_mul_thread
File "videotrans\tts\_base.py", line 216, in _item_task
File "videotrans\tts\_index.py", line 40, in _run
File "videotrans\tts\_gradio.py", line 76, in _send
videotrans.configure.excepts.StopTask: index 该渠道需另行部署并启动后可用
self.api_url='http://127.0.0.1:7860'
Could not get Gradio config from: http://127.0.0.1:7860/


=
system:Windows-10-10.0.26300-SP0
version:v4.19
frozen:True
language:zh_CN
root_dir:D:/TK/win-pyvideotrans-v4.19

1 Replies

#1 DeepSeek reply at 11 hours ago

核心原因:软件通过 gradio_client 读取 http://127.0.0.1:7860/ 的 Gradio 配置并解析,但返回内容不是合法的 Gradio config(_get_config 中 NoneType has no attribute 'group' 就是因为解析不到版本/配置字段),说明该地址上没有可正常访问的 Index-TTS Gradio WebUI 服务,或部署端 Gradio 版本与软件内置的 gradio_client 不兼容。

排查与解决(按顺序):

  1. 确认服务真的在跑、且是 WebUI 而非 API

    • 浏览器打开 http://127.0.0.1:7860,能正常看到 Index-TTS 的 Gradio 页面才说明可用。打不开 = 服务未启动或端口不对。
    • 报错里 role: 'en_female_2.wav' 说明你走的是 Index-TTS(本地API)配音渠道,该渠道是通过 Gradio WebUI 通信的,必须启动带界面的 webui.py,不能只起一个纯 API 服务。
    • 7860 是默认端口,若被占用,Index-TTS 会换到 7861/7862 等,请以终端实际打印的 Running on local URL: 为准,并到 菜单 → 配音设置 → Index-TTS 把地址改成一致(必须写 127.0.0.1,不能写 0.0.0.0)。
  2. 地址格式检查

    • 必须是 http://127.0.0.1:端口 形式;若 Index-TTS 启动在子路径(如 http://127.0.0.1:7860/index 或 /gradio),需把完整路径填进去。
    • 跨机器/容器部署时,用实际 IP,并确保本机能访问该端口(防火墙、端口映射)。
  3. 解决 Gradio 版本不兼容(最常见的隐性原因)

    • 预打包版 v4.19 内置的 gradio_client 版本固定;若你部署的 Index-TTS 使用 Gradio 5.x,其 /config 接口结构变化,就会出现此报错。
    • 处理方式:在 Index-TTS 的部署环境中把 Gradio 降到其项目要求版本(官方 requirements 中指定的 4.x),例如:

      pip install "gradio==4.44.1"

      然后重启 Index-TTS 的 webui.py,再回软件点“试听/重新配音”。

  4. 启动命令建议

    • 在 Index-TTS 项目目录执行 uv run webui.py(或 python webui.py),保持该终端窗口不关闭;首次加载模型需较长时间,加载完成前连接也会失败。
  5. 附带修复一个常见的 index-tts 报错:若之后出现 Value: 'Same as the voice reference' is not in the list of choices,请在 Index-TTS 目录的 webui.py 中把 i18n("与音色参考音频相同") 替换为英文 Same as the voice reference 后重启服务。

若浏览器能正常打开该地址、Gradio 版本也已匹配,但仍然报同样错误,请提供 Index-TTS 终端启动时打印的完整日志(含 Running on local URL 与版本号)以及软件 logs/ 下当天日志底部约 30 行,以便进一步定位。

请查阅相关文档:

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