#4768 LLM重新断句一直失效

183.14* Posted at: 5 hours ago

we're going to move on to other stuff.\n\n65\n00:07:31,360 --> 00:07:31,984\n You.\n\n66\n00:07:32,208 --> 00:07:35,984\n Uh and i'm going to clip that out and share that with other people.\n`"}]
[INFO] Finished call to 'videotrans.translator._chatgpt.ChatGPT.llm_segment.._send' after 44.938(s), this was the 2nd time calling it.
[WARNING] 重新断句失败[except],已恢复原样 RetryError[]
[WARNING] 重新断句失败[except],已恢复原样 RetryError[]
self.trans_thread=50,self.aisendsrt=True,self.translate_type=4
[DEBUG] [deepseek]响应:response=ChatCompletion(id='c7b117ec-2715-4b7e-9df3-5c85858ca6e2', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='\n1\n00:00:00,000 --> 00:00:00,608\n你。\n\n2\n00:00:01,040 --> 00:00:06,176\n好了,把这个放进来。接下来我要做的就是把

3 Replies

LLM 重新断句失败的原因是 APIConnectionError,即与 AI 模型 API 的连接失败,这通常是网络或配置问题。

请依次排查:

  1. 检查网络代理设置
    如果使用的是 OpenAI、DeepSeek 等国外服务,必须在主界面 “网络代理地址” 中填写正确的代理地址,例如 http://127.0.0.1:7890。若不清楚代理请保持留空,但国内无法直连这些服务时就会报连接错误。
  2. 确认 API Key 与模型名称

    • 前往 菜单→翻译设置→对应渠道(例如 DeepSeek 或 OpenAI ChatGPT),确保 API Key 正确且未过期。
    • 模型名称必须手动输入有效值(如 deepseek-chatgpt-4o),不同渠道名称不同。
  3. 降低并发与请求频率
    日志显示 self.trans_thread=50,并发过高可能导致连接失败。建议:

    • 打开 菜单→工具→高级选项→字幕翻译调整,将 AI翻译渠道每批字幕行数 设为较小的值(如 5~10),翻译后暂停秒 设为 1~2 秒。
    • 通用设置 中将 AI翻译一次性翻译所有字幕行 取消勾选(默认为按批次发送)。
  4. 重试次数
    过高的重试次数无法解决根本问题,建议保持默认值(如 2~3 次)。
  5. 使用本地模型替代
    如果网络问题无法解决,可改用 M2M100 本地翻译(无需网络),或配置本地部署的 LLM 作为翻译渠道(如 Ollama)。

请查阅相关文档:

Deepseek网络代理地址填什么

DeepSeek 是国产 AI 模型,其 API(api.deepseek.com)在国内可以直接访问,通常无需配置网络代理。请将软件主界面的“网络代理地址”文本框保持留空

如果你所在网络环境(如公司内网、校园网)限制了外部 API 访问,必须使用代理的话,格式为 http://127.0.0.1:端口号(例如 http://127.0.0.1:7890),但错误的代理设置反而会导致连接失败。

排查步骤:

  1. 确保在 菜单 → 翻译设置 → DeepSeek 中,API Key 填写正确且未过期。
  2. 确认 DeepSeek 的 API URL 保持默认值 https://api.deepseek.com
  3. 若仍报连接错误,可临时切换到其他国内翻译渠道(如微软免费翻译、阿里机器翻译)验证是否为 DeepSeek 服务本身问题。

请查阅相关文档:

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