#6076 Response ended prematurely:{'text': '你好啊我的朋友', 'role': 'cosy.wav', 'filename': 'H:/pyvideotrans/tmp/31272/1784953427.555

240e:39c* Posted at: 17 hours ago

Response ended prematurely:
{'text': '你好啊我的朋友', 'role': 'cosy.wav', 'filename': 'H:/pyvideotrans/tmp/31272/1784953427.555445-gptsovits.wav', 'tts_type': 12}
Traceback (most recent call last):
File "requests\models.py", line 820, in generate
File "urllib3\response.py", line 1088, in stream
File "urllib3\response.py", line 1248, in read_chunked
File "urllib3\response.py", line 1178, in _update_chunk_length
urllib3.exceptions.ProtocolError: Response ended prematurely

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 207, in run
File "videotrans\tts\_base.py", line 141, in run
File "videotrans\tts\_base.py", line 228, in _item_task
File "videotrans\tts\_gptsovits.py", line 77, in _run
File "requests\api.py", line 115, in post
File "requests\api.py", line 59, in request
File "requests\sessions.py", line 589, in request
File "requests\sessions.py", line 746, in send
File "requests\models.py", line 902, in content
File "requests\models.py", line 822, in generate
requests.exceptions.ChunkedEncodingError: Response ended prematurely


=
system:Windows-10-10.0.26100-SP0
version:v4.07
frozen:True
language:zh
root_dir:H:/pyvideotrans

1 Replies

根据报错,Response ended prematurely 表明软件向 CosyVoice API 发送请求时,服务端在返回数据过程中连接中断,通常由以下原因导致:

  1. CosyVoice 服务未正常启动或已崩溃:请检查你是否已自行部署并运行了 CosyVoice 的 WebUI 或 API 服务。该错误常见于服务未完全加载便退出,或处理请求时内部出错。
  2. API 地址配置错误:在 菜单 → TTS 设置 → CosyVoice 中填写的地址必须是有效的本地服务地址(如 http://127.0.0.1:8000),且不能是 0.0.0.0。软件会自动检测并提示无效地址。
  3. 网络不稳定或防火墙阻断:如果 CosyVoice 服务与本软件运行在同一台电脑,请确认无防火墙拦截本地请求;若是远程部署,请检查网络连接及端口是否开放。

解决方案:

  1. 重启 CosyVoice 服务,并确认其控制台无其他报错(例如显存不足、模型加载失败等)。
  2. 检查 API 地址设置:打开软件 菜单 → TTS 设置 → CosyVoice,确认地址格式正确(例如 http://127.0.0.1:9880),并确保端口与 CosyVoice 实际监听端口一致。
  3. 如果问题持续,尝试使用其他免费配音渠道(如 Edge-TTS)或本地内置渠道(如 Qwen-TTS)测试,以排除 CosyVoice 本身的问题。

若以上仍无法解决,请提供 CosyVoice 服务端的日志或报错信息,以便进一步分析。

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.

Dondate via ko-fi.com

Dondate via PayPal

Related resource