#7365 翻译字幕阶段出错 [DeepSeek] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数Could not parse response content as the length limit w

116.16**9 Posted at: 2 hours ago

翻译字幕阶段出错 [DeepSeek] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8192, prompt_tokens=2117, total_tokens=10309, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=8192, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=1920), prompt_cache_hit_tokens=1920, prompt_cache_miss_tokens=197)
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 981, in run
File "videotrans\translator\_base.py", line 97, in run
File "videotrans\translator\_base.py", line 161, in _run_srt
File "videotrans\translator\_deepseek.py", line 63, in _item_task
openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8192, prompt_tokens=2117, total_tokens=10309, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=8192, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=1920), prompt_cache_hit_tokens=1920, prompt_cache_miss_tokens=197)
TaskCfgSTS(is_cuda=False, uuid='e0a94e8cb0', cache_folder=None, target_dir='E:/videotrans/output/translate', source_language=None, source_language_code='English', source_sub='C:/Users/Administrator/Desktop/9.13英文.srt', source_wav=None, source_wav_output=None, target_language=None, target_language_code='Simplified Chinese', target_sub='E:/videotrans/output/translate/9.13英文.Simplified Chinese.srt', target_wav=None, target_wav_output=None, name='C:/Users/Administrator/Desktop/9.13英文.srt', noextname='9.13英文', basename='9.13英文.srt', ext='srt', dirname='C:/Users/Administrator/Desktop', shound_del_name=None, translate_type=4)


=
system:Windows-10-10.0.19045-SP0
version:v3.99
frozen:True
language:zh
root_dir:D:/Program Files/videotrans

1 Replies

#1 DeepSeek reply at 2 hours ago

这是由于 DeepSeek 的 deepseek-v4-pro 等模型默认开启了思考模式(Thinking),思考过程消耗了全部 8192 输出 Token,导致正文没有足够空间输出,触发 LengthFinishReasonError

解决方案(任选其一,推荐同时操作):

  1. 关闭 DeepSeek 思考模式(首选)
    进入 菜单 → 翻译设置 → DeepSeek,在设置面板中取消勾选 Thinking 复选框,保存后重试。思考模式需要较大的 max_token,关闭后即可正常翻译。
  2. 降低每批发送的字幕行数
    进入 菜单 → 工具 → 高级选项 → 字幕翻译,将 AI翻译渠道每批字幕行数 调小至 10~20,减少单次请求内容量。
  3. 换用非思考模型
    将模型名称改为 deepseek-v4-flash 等非推理模型,避免思考 Token 占用。

另外,你的版本为 v3.99(当前最新为 v4.12),且安装在 D:/Program Files/ 目录下,存在权限风险,建议升级到最新版本并移动到浅层英文目录(如 D:/pyVideoTrans)。

请查阅相关文档:

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