#2898 requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:9872/api/predict/tts?text=%E4%BD%A0

39.68* Posted at: 1 day ago 👁11

404 Client Error: Not Found for url: http://localhost:9872/api/predict/tts?text=%E4%BD%A0%E5%A5%BD%E5%95%8A%E6%88%91%E7%9A%84%E6%9C%8B%E5%8F%8B.+&text_lang=zh&ref_audio_path=kelong.wav&prompt_text=Hello%2C+this+is+my+test+voice&prompt_lang=en&speed_factor=1.0:
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 18, in run
File "videotrans\tts\__init__.py", line 284, in run
File "videotrans\tts\_base.py", line 179, in run
File "videotrans\tts\_base.py", line 208, in _local_mul_thread
File "videotrans\tts\_gptsovits.py", line 98, in _item_task
File "requests\models.py", line 1026, in raise_for_status
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:9872/api/predict/tts?text=%E4%BD%A0%E5%A5%BD%E5%95%8A%E6%88%91%E7%9A%84%E6%9C%8B%E5%8F%8B.+&text_lang=zh&ref_audio_path=kelong.wav&prompt_text=Hello%2C+this+is+my+test+voice&prompt_lang=en&speed_factor=1.0


=
system:Windows-10-10.0.19045-SP0
version:v3.92
frozen:True
language:zh
root_dir:A:/

1 Replies

这是由于 GPT-SoVITS API 服务未正确启动或 API 地址配置错误导致的。

  1. 确认 GPT-SoVITS API 服务状态

    • 确保您已按照官方文档部署了 GPT-SoVITS 并启动了其 API 服务。
    • 检查启动 GPT-SoVITS 的终端窗口是否仍在运行,且没有报错。
    • 默认情况下,GPT-SoVITS 的 API 地址应为 http://127.0.0.1:9872。请确保端口号 9872 与您启动的服务端口一致。
  2. 检查 pyVideoTrans 中的配置

    • 在 pyVideoTrans 的“配音渠道”中,选择“GPT-SoVITS”。
    • 确认“API 地址”字段填写正确(例如 http://127.0.0.1:9872)。
    • 如果您的 GPT-SoVITS 使用了 api_v2 接口,请确保在 API 地址中包含了正确的路径(例如 http://127.0.0.1:9872/api/v2),否则会出现 404 错误。
  3. 手动测试 API 连接

    • 打开浏览器,访问您配置的 API 地址(例如 http://127.0.0.1:9872http://127.0.0.1:9872/docs)。
    • 如果无法访问,说明 GPT-SoVITS 服务未成功启动。请检查其部署日志,确保模型已正确加载且服务已绑定到 0.0.0.0127.0.0.1

参考文档:

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.

Related resource

Similar issues already exist