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

117.182* Posted at: 11 hours ago

翻译字幕阶段出错 [DeepSeek] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8192, prompt_tokens=2257, total_tokens=10449, 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=2176), prompt_cache_hit_tokens=2176, prompt_cache_miss_tokens=81)
Traceback (most recent call last):
File "videotrans\task\job.py", line 173, in run
File "videotrans\task\trans_create.py", line 645, 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 li
......
ng_tokens=8192, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=2176), prompt_cache_hit_tokens=2176, prompt_cache_miss_tokens=81)
TaskCfgVTT(is_cuda=True, uuid='4831031e1e', cache_folder='D:/win-pyvideotrans-v3.97-0304/tmp/29384/4831031e1e', target_dir='E:/0.影视解说/1.解说库/0731/1.对标/_video_out/去他x的世界-S1E5-mp4', source_language='法语', source_language_code='fr', source_sub='E:/0.影视解说/1.解说库/0731/1.对标/_video_out/去他x的世界-S1E5-mp4/fr.srt', source_wav='D:/win-pyvideotrans-v3.97-0304/tmp/29384/4831031e1e/fr.wav', source_wav_output='E:/0.影视解说/1.解说库/0731/1.对标/_video_out/去他x的世界-S1E5-mp4/fr.m4a', target_language='简体中文', target_language_code='zh-cn', target_sub='E:/0.影视解说/1.解说库/0731/1.对标/_video_out/去他x的世界-S1E5-mp4/zh-cn.srt', target_wav='D:/win-pyvideotrans-v3.97-0304/tmp/29384/4831031e1e/target.wav', target_wav_output='E:/0.影视解说/1.解说库/0731/1.对标/_video_out/去他x的世界-S1E5-mp4/zh-cn.m4a', name='E:/0.影视解说/1.解说库/0731/1.对标/去他x的世界-S1E5.MP4', noextname='去他x的世界-S1E5', basename='去他x的世界-S1E5.MP4', ext='mp4', dirname='E:/0.影视解说/1.解说库/0731/1.对标', shound_del_name=None, translate_type=4, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', voice_autorate=False, video_autorate=True, remove_silent_mid=False, align_sub_audio=True, detect_language='fr', recogn_type=0, model_name='large-v3', shibie_audio=None, remove_noise=True, enable_diariz=False, nums_diariz=3, rephrase=1, fix_punc=False, subtitle_language=None, app_mode='tiqu', subtitles='', targetdir_mp4='E:/0.影视解说/1.解说库/0731/1.对标/_video_out/去他x的世界-S1E5-mp4/去他x的世界-S1E5.mp4', novoice_mp4='D:/win-pyvideotrans-v3.97-0304/tmp/29384/4831031e1e/novoice.mp4', is_separate=False, instrument=None, vocal=None, back_audio='', clear_cache=False, background_music=None, subtitle_type=0, only_out_mp4=False, recogn2pass=True, output_srt=0, copysrt_rawvideo=False)


=
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 模型推理(reasoning)token 消耗完了全部输出配额导致的。错误中 reasoning_tokens=8192 表示模型将所有输出 token 都用于“思考”,最终没有产生实际翻译文本,从而触发长度限制错误。

解决方案

  1. 增大 max_token 上限
    打开 菜单 → 翻译设置 → DeepSeek 渠道设置,将 max_token 从默认值调大(建议设置为 8192 或更高),给模型留出推理和翻译输出的空间。
  2. 降低每次发送字幕行数
    进入 菜单 → 工具 → 高级选项 → 字幕翻译调整,降低 AI翻译渠道每批字幕行数(如从 100 调低到 20~30),减少单次请求所包含的翻译内容量,可有效避免超长截断。
  3. 临时改用非推理模型
    如果 DeepSeek 渠道支持选择模型,可尝试切换为非 reasoning 型号;或在翻译设置中选择 deepseek-v4-flash 等轻量模型,降低推理 token 消耗。
  4. 降低识别/断句负担(可选)
    日志中 rephrase=1(LLM 重新断句)也会占用大模型请求,若仍然频繁失败,可在高级选项中将 LLM重新断句 关闭后再试。
  5. 升级软件版本
    当前版本为 v3.97,建议下载最新完整包或补丁包升级到 v4.08,新版本对 token 超限和翻译渠道容错均有优化。

请查阅相关文档:

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