#7039 翻译字幕阶段出错 [兼容AI/本地模型] Connection error.Traceback (most recent call last):

203.175**3 Posted at: 1 hour ago

翻译字幕阶段出错 [兼容AI/本地模型] Connection error.
Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 250, in handle_request
File "httpcore\_sync\connection_pool.py", line 216, in handle_request
File "httpcore\_sync\connection_pool.py", line 196, in handle_request
File "httpcore\_sync\http_proxy.py", line 289, in handle_request
File "httpcore\_sync\connection.py", line 99, in handle_request
File "httpcore\_sync\connection.py", line 76, in handle_request
File "httpcore\_sync\connection.py", line 122, in _connect
File "httpcore\_backends\sync.py", line 205, in connect_tcp
File "contextlib.py", line 153, in exit
File "httpcore\_exceptions.py", line 14, in map_exceptions
httpcore.ConnectError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

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

Traceback (most recent call last):
File "openai\_base_client.py", line 1005, in request
File "httpx\_client.py", line 914, in send
File "httpx\_client.py", line 942, in _send_handling_auth
File "httpx\_client.py", line 979, in _send_handling_redirects
File "httpx\_client.py", line 1014, in _send_single_request
File "httpx\_transports\default.py", line 249, in handle_request
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.ConnectError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

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

Traceback (most recent call last):
File "videotrans\task\job.py", line 173, in run
File "videotrans\task\_translate_srt.py", line 44, in trans
File "videotrans\translator\__init__.py", line 1000, in run
File "videotrans\translator\_base.py", line 100, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_localllm.py", line 49, in _item_task
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\chat\completions\completions.py", line 1211, in create
File "openai\_base_client.py", line 1297, in post
File "openai\_base_client.py", line 1037, in request
openai.APIConnectionError: Connection error.
TaskCfgSTS(is_cuda=False, uuid='a510ba7253', cache_folder=None, target_dir='D:/临时下载文件/离婚冷静期后他净身出户', source_language=None, source_language_code='Simplified Chinese', source_sub='D:/临时下载文件/离婚冷静期后他净身出户/1.zh.srt', source_wav=None, source_wav_output=None, target_language=None, target_language_code='English', target_sub='D:/临时下载文件/离婚冷静期后他净身出户/1.zh.English.srt', target_wav=None, target_wav_output=None, name='D:/临时下载文件/离婚冷静期后他净身出户/1.zh.srt', noextname='1.zh', basename='1.zh.srt', ext='srt', dirname='D:/临时下载文件/离婚冷静期后他净身出户', shound_del_name=None, translate_type=8)


=
system:Windows-10-10.0.22631-SP0
version:v3.99
frozen:True
language:zh
root_dir:D:/win-pyvideotrans-v3.99-428

1 Replies

#1 DeepSeek reply at 1 hour ago

这是由于你配置的「兼容AI/本地模型」翻译渠道 API 地址无法连接(目标计算机拒绝连接),通常是本地服务未启动、地址/端口填写错误,或 API 地址填成了 0.0.0.0

请按以下步骤排查:

  1. 确认你本地部署的兼容 OpenAI 接口的大模型服务(如 Ollama、LM Studio、vLLM、LocalAI 等)已经启动并正常运行,且服务窗口无报错。
  2. 检查软件中填写的 API 地址是否正确:

    • 若地址填写了 0.0.0.0,必须改为 127.0.0.1
    • 本地服务地址格式应为 http://127.0.0.1:端口号http://localhost:端口号,不要漏掉端口号,也不要使用 /v1 之后多余的路径(如 /v1/chat/completions,只需填到 http://127.0.0.1:端口号/v1 即可,具体以渠道要求为准)。
  3. 通过浏览器或 Postman 直接访问该地址的 /v1/models 路径,测试能否正常返回 JSON,确认服务端口是否真的在监听。
  4. 检查是否误填了代理地址。该渠道属于本地服务,不需要代理,软件内置了免代理域名列表,但如果全局代理配置异常仍可能被拦截,可暂时清空代理文本框再试。
  5. 确认防火墙或杀毒软件没有拦截本地端口监听。

如果以上仍未解决,请提供你的操作系统、软件版本号、该渠道填写的具体 API 地址,以及 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