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

223.79.**3 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=2331, total_tokens=10523, 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=512), prompt_cache_hit_tokens=512, prompt_cache_miss_tokens=1819)
Traceback (most recent call last):
File "videotrans\task\job.py", line 174, in run
File "videotrans\task\_translate_srt.py", line 45, in trans
File "videotrans\translator\__init__.py", line 972, in run
File "videotrans\translator\_base.py", line 102, in run
File "videotrans\translator\_base.py", line 165, in _run_srt
File "videotrans\translator\_deepseek.py", line 66, in _item_task
openai.LengthFinishReasonError: Could not parse response content as the length l
......
okens=10523, 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=512), prompt_cache_hit_tokens=512, prompt_cache_miss_tokens=1819)
TaskCfg(cache_folder=None, target_dir='D:/TutorialTrans/26-08/Blender + Unreal Engine 5 创建专业级环境场景/6 - 最终模块化建模(Blender)B 模块', remove_noise=False, is_separate=False, detect_language=None, subtitle_language=None, source_language=None, target_language=None, source_language_code='Spanish', target_language_code='Simplified Chinese', source_sub='D:/TutorialTrans/26-08/Blender + Unreal Engine 5 创建专业级环境场景/6 - 最终模块化建模(Blender)B 模块/19. 制作通道门与 B 模块基础结构.srt', target_sub='D:/TutorialTrans/26-08/Blender + Unreal Engine 5 创建专业级环境场景/6 - 最终模块化建模(Blender)B 模块/19. 制作通道门与 B 模块基础结构.Simplified Chinese.srt', source_wav=None, source_wav_output=None, target_wav=None, target_wav_output=None, subtitles='', novoice_mp4=None, noextname='19. 制作通道门与 B 模块基础结构', shibie_audio=None, targetdir_mp4=None, instrument=None, vocal=None, back_audio=None, background_music=None, app_mode='biaozhun', subtitle_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role=None, copysrt_rawvideo=False, clear_cache=False, translate_type=4, tts_type=None, recogn_type=None, model_name=None, voice_autorate=False, video_autorate=False, cuda=False, name='D:/TutorialTrans/26-08/Blender + Unreal Engine 5 创建专业级环境场景/6 - 最终模块化建模(Blender)B 模块/19. 制作通道门与 B 模块基础结构.srt', basename='19. 制作通道门与 B 模块基础结构.srt', ext='srt', dirname='D:/TutorialTrans/26-08/Blender + Unreal Engine 5 创建专业级环境场景/6 - 最终模块化建模(Blender)B 模块', shound_del_name=None, uuid='ee7e5405e7', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=2, only_out_mp4=False, fix_punc=False, recogn2pass=False)


=
system:Windows-10-10.0.19045-SP0
version:v3.96
frozen:True
language:zh
root_dir:D:/AI/win-pyvideotrans-v3.95

1 Replies

这是 DeepSeek 的“思考模式(Thinking)”导致的:模型在输出正式翻译前首先生成了大量推理 token(日志中 reasoning_tokens=8192),直接占满了 max_tokens=8192 的输出限额,因此返回“内容太长超出最大允许Token”。

解决方案按优先级操作:

  1. 打开 菜单 → 翻译设置 → DeepSeek,在设置面板中取消勾选 Thinking(思考模式),保存后重试。这是最推荐的方式,可立即释放输出额度,避免推理 token 挤占翻译内容。
  2. 若仍需保留思考模式,请在该面板中显著增大 max_token(例如设置为 16000 或更高),确保正式翻译内容有足够空间。
  3. 也可以在主界面 高级选项 → 字幕翻译调整降低“AI翻译渠道每批字幕行数”(例如从默认调低到 20 或更少),减少单次请求需要输出的内容量。
  4. 若以上改动后仍失败,请更新软件到最新版本(你当前为 v3.96,建议升级到 v4.09 或最新补丁包),旧版在 DeepSeek 新版模型的 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