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

117.182* Posted at: 1 day ago

翻译字幕阶段出错 [DeepSeek] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8191, prompt_tokens=987, total_tokens=9178, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=8191, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=768), prompt_cache_hit_tokens=768, prompt_cache_miss_tokens=219)
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 101, in run
File "videotrans\translator\_base.py", line 164, in _run_srt
File "videotrans\translator\_deepseek.py", line 61, in _item_task
openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8191, prompt_tokens=987, total_tokens=9178, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=8191, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=768), prompt_cache_hit_tokens=768, prompt_cache_miss_tokens=219)
TaskCfgSTS(is_cuda=False, uuid='cf2711a312', cache_folder=None, target_dir='D:/[大红狗克里弗]Clifford.The.Big.Red.Dog.2021.MULTi.1080p.HDLight.x264.AC3-EXTREME', source_language=None, source_language_code='French', source_sub='D:/[大红狗克里弗]Clifford.The.Big.Red.Dog.2021.MULTi.1080p.HDLight.x264.AC3-EXTREME/Clifford.The.Big.Red.Dog.2021.MULTi.1080p.HDLight.x264.AC3-EXTREME_French [fre] (SUBRIP).srt', source_wav=None, source_wav_output=None, target_language=None, target_language_code='Simplified Chinese', target_sub='D:/[大红狗克里弗]Clifford.The.Big.Red.Dog.2021.MULTi.1080p.HDLight.x264.AC3-EXTREME/Clifford.The.Big.Red.Dog.2021.MULTi.1080p.HDLight.x264.AC3-EXTREME_French [fre] (SUBRIP).Simplified Chinese.srt', target_wav=None, target_wav_output=None, name='D:/[大红狗克里弗]Clifford.The.Big.Red.Dog.2021.MULTi.1080p.HDLight.x264.AC3-EXTREME/Clifford.The.Big.Red.Dog.2021.MULTi.1080p.HDLight.x264.AC3-EXTREME_French [fre] (SUBRIP).srt', noextname='Clifford.The.Big.Red.Dog.2021.MULTi.1080p.HDLight.x264.AC3-EXTREME_French [fre] (SUBRIP)', basename='Clifford.The.Big.Red.Dog.2021.MULTi.1080p.HDLight.x264.AC3-EXTREME_French [fre] (SUBRIP).srt', ext='srt', dirname='D:/[大红狗克里弗]Clifford.The.Big.Red.Dog.2021.MULTi.1080p.HDLight.x264.AC3-EXTREME', shound_del_name=None, translate_type=4)


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

1 Replies

这是 DeepSeek 大模型返回内容达到“最大输出 token”上限导致的。日志中 completion_tokens=8191reasoning_tokens=8191,说明模型的推理过程已经耗尽全部输出额度,翻译内容尚未生成就被截断,因此报“内容太长超出最大允许Token”。

解决方法(按顺序尝试):

  1. 增大 DeepSeek 的 max_token:打开 菜单 -> 翻译设置 -> DeepSeek,将最大输出 token 调大到 16384 或更高,保存后重试。
  2. 降低每批发送字幕行数:打开 菜单 -> 工具/选项 -> 高级选项 -> 字幕翻译调整,将 AI翻译渠道每批字幕行数 调小,例如改为 1020,保存后重试。
  3. 若仍报错,可在 DeepSeek 渠道设置中改用非推理模型(如 deepseek-v4-flash),避免 reasoning token 占满输出额度。
  4. 你的版本为 v3.97,较旧,建议从官方渠道下载最新完整包或补丁包升级到 v4.08,新版本对 DeepSeek 渠道的 token 处理兼容性更好。

补充提醒:当前输出路径含中文和方括号(D:/[大红狗克里弗]...),虽不是本次报错的直接原因,但后续 ffmpeg 合成阶段可能因特殊符号/长路径出现问题。建议将视频放到类似 D:\videos 的纯英文路径下处理。

请查阅相关文档:

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