#2491 TaskCfg(cache_folder='D:/fanyi/win-pyvideotrans-v3.86/tmp45944/93ee5aea2a', target_dir='C:/Users/64693/Desktop/新建文件夹 (2)

58.152* Posted at: 1 day ago 👁16

翻译字幕阶段出错:[DeepSeek] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8092, prompt_tokens=1468, total_tokens=9560, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=448), prompt_cache_hit_tokens=448, prompt_cache_miss_tokens=1020):
Traceback (most recent call last):
File "videotrans\task\job.py", line 184, in run
File "videotrans\task\trans_create.py", line 423, in trans
File "videotrans\translator\__init__.py", line 922, in run
File "videotrans\translator\_base.py", line 77, in run
File "videotrans\translator\_base.py", line 135, in _run_srt
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 400, in
File "concurrent\futures\_base.py", line 439, in result
File "concurrent\futures\_base.py", line 391, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_deepseek.py", line 66, in _item_task
openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8092, prompt_tokens=1468, total_tokens=9560, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=448), prompt_cache_hit_tokens=448, prompt_cache_miss_tokens=1020)

TaskCfg(cache_folder='D:/fanyi/win-pyvideotrans-v3.86/tmp45944/93ee5aea2a', target_dir='C:/Users/64693/Desktop/新建文件夹 (2)/_video_out/MIAA-704 Himari 和我喜歡的人結婚真', remove_noise=False, is_separate=False, detect_language='ja', subtitle_language=None, source_language='日语', target_language='简体中文', source_language_code='ja', target_language_code='zh-cn', source_sub='C:/Users/64693/Desktop/新建文件夹 (2)/_video_out/MIAA-704 Himari 和我喜歡的人結婚真/ja.srt', target_sub='C:/Users/64693/Desktop/新建文件夹 (2)/_video_out/MIAA-704 Himari 和我喜歡的人結婚真/zh-cn.srt', source_wav='D:/fanyi/win-pyvideotrans-v3.86/tmp45944/93ee5aea2a/ja.wav', source_wav_output='C:/Users/64693/Desktop/新建文件夹 (2)/_video_out/MIAA-704 Himari 和我喜歡的人結婚真/ja.m4a', target_wav='D:/fanyi/win-pyvideotrans-v3.86/tmp45944/93ee5aea2a/target.wav', target_wav_output='C:/Users/64693/Desktop/新建文件夹 (2)/_video_out/MIAA-704 Himari 和我喜歡的人結婚真/zh-cn.m4a', subtitles='', novoice_mp4='D:/fanyi/win-pyvideotrans-v3.86/tmp45944/93ee5aea2a/novoice.mp4', noextname='MIAA-704 Himari 和我喜歡的人結婚真', shibie_audio=None, targetdir_mp4='C:/Users/64693/Desktop/新建文件夹 (2)/_video_out/MIAA-704 Himari 和我喜歡的人結婚真/MIAA-704 Himari 和我喜歡的人結婚真.mp4', instrument=None, vocal=None, back_audio='', background_music=None, app_mode='tiqu', subtitle_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', copysrt_rawvideo=False, clear_cache=False, translate_type=4, tts_type=0, recogn_type=0, model_name='large-v3-turbo', split_type=0, voice_autorate=False, video_autorate=True, cuda=True, name='C:/Users/64693/Desktop/新建文件夹 (2)/MIAA-704 Himari 和我喜歡的人結婚真.ts', basename='MIAA-704 Himari 和我喜歡的人結婚真.ts', ext='ts', dirname='C:/Users/64693/Desktop/新建文件夹 (2)', shound_del_name=None, uuid='93ee5aea2a', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, auto_fix=True)


=
system:Windows-10-10.0.26200-SP0
version:v3.86
frozen:True
language:zh
root_dir:D:/fanyi/win-pyvideotrans-v3.86

1 Replies

错误提示表明 DeepSeek 翻译时内容超出了最大 Token 限制。请按以下步骤调整:

  1. 减少单次发送内容:在菜单栏选择 工具/选项 -> 高级选项
  2. 在“字幕翻译调整”区域,将“同时翻译字幕数”从默认值(例如 50)大幅降低,建议先设为 105
  3. 如果问题依旧,可以进一步降低到 1(串行翻译,速度慢但最稳定)。

可选操作

  • 如果视频字幕量极大,可考虑在翻译前,使用“工具箱 -> 视频剪辑”功能,将长视频分割成多个片段分别处理。
  • 确保你使用的 DeepSeek API Key 具有足够的额度或支持长上下文模型。

调整后重新运行翻译任务即可。

请查看更多参考文档:

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.

Donate: https://ko-fi.com/jianchang512

Similar issues already exist

Trending Questions