#7103 翻译字幕阶段出错 [DeepSeek] Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens

18.140**1 Posted at: 1 hour ago

翻译字幕阶段出错 [DeepSeek] Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=65536, prompt_tokens=724, total_tokens=66260, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=640), prompt_cache_hit_tokens=640, prompt_cache_miss_tokens=84)
Traceback (most recent call last):

File "videotrans\translator\_base.py", line 68, in run

File "videotrans\translator\_base.py", line 106, in _run_text

File "tenacity\__init__.py", line 338, in wrapped_f

File "tenacity\__init__.py", line 477, in call

File "tenacity\__init__.py", line 378, in iter

File "tenacity\__init__.py", line 421, in exc_check

tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 137, in process_task

File "videotrans\task\translate_srt.py", line 51, in trans

File "videotrans\translator\_runner.py", line 67, in run

File "videotrans\translator\_base.py", line 74, in run

File "tenacity\__init__.py", line 480, in call

File "videotrans\translator\_openaicompat.py", line 107, in _item_task

openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=65536, prompt_tokens=724, total_tokens=66260, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=640), prompt_cache_hit_tokens=640, prompt_cache_miss_tokens=84)
[TranslateSrt]翻译字幕: OutputFormat=双语(目标语言在上)
[TaskCfgSTS]
原始输入文件名: C:/Users/共产主义者/Downloads/用于字幕提取-mp4/th.srt,
输出结果保存到文件夹: D:/BaiduNetdiskDownload/win-pyvideotrans-v4.12/output/translate
翻译渠道:DeepSeek,原始语言:th,目标语言:zh-cn, 未选 发送完整字幕
代理地址:http://127.0.0.1:7897


=
system:Windows-10-10.0.19045-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:D:/BaiduNetdiskDownload/win-pyvideotrans-v4.12

1 Replies

#1 DeepSeek reply at 1 hour ago

这是 DeepSeek 思考模式(Thinking)导致的输出长度超出上限问题。DeepSeek 在思考模式下会生成大量思维链 token,若同时每次翻译的字幕行数较多,模型在达到 65536 token 上限前仍未完成输出,响应被截断,从而报 LengthFinishReasonError

解决方法

  1. 关闭 DeepSeek 思考模式

    • 打开 菜单 -> 翻译设置 -> DeepSeek
    • 取消选中 Thinking 复选框
    • 重新保存配置
  2. 减小每批翻译字幕行数

    • 打开 菜单 -> 工具 -> 高级选项 -> 字幕翻译调整
    • AI翻译渠道每批字幕行数 调小,建议设置为 20 或更小(例如 10
    • 若仍报错,可继续减小
  3. 重启任务

    • 回到主界面,重新执行翻译字幕任务(建议先勾选主界面的 清理已生成 以清除旧缓存)
注意:DeepSeek 为国内 API,通常不需要代理。你当前填写的代理 http://127.0.0.1:7897 建议清空,以避免不必要的网络干扰。

请查阅相关文档:

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