#4025 TaskCfg(cache_folder='D:/translater/win-pyvideotrans-v3.97/tmp/13080/132fdf2cc4', target_dir='D:/360安全浏览器下载/tatai/1-mp4'

219.227* Posted at: 2 hours ago 👁6

翻译字幕阶段出错 [DeepSeek] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8192, prompt_tokens=1694, total_tokens=9886, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=1694)
Traceback (most recent call last):
File "videotrans\task\job.py", line 174, in run
File "videotrans\task\trans_create.py", line 637, 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 limit was reached - CompletionUsage(completion_tokens=8192, prompt_tokens=1694, total_tokens=9886, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=1694)
TaskCfg(cache_folder='D:/translater/win-pyvideotrans-v3.97/tmp/13080/132fdf2cc4', target_dir='D:/360安全浏览器下载/tatai/1-mp4', remove_noise=True, is_separate=False, detect_language='th', subtitle_language=None, source_language='泰国语', target_language='简体中文', source_language_code='th', target_language_code='zh-cn', source_sub='D:/360安全浏览器下载/tatai/1-mp4/th.srt', target_sub='D:/360安全浏览器下载/tatai/1-mp4/zh-cn.srt', source_wav='D:/translater/win-pyvideotrans-v3.97/tmp/13080/132fdf2cc4/th.wav', source_wav_output='D:/360安全浏览器下载/tatai/1-mp4/th.m4a', target_wav='D:/translater/win-pyvideotrans-v3.97/tmp/13080/132fdf2cc4/target.wav', target_wav_output='D:/360安全浏览器下载/tatai/1-mp4/zh-cn.m4a', subtitles='', novoice_mp4='D:/translater/win-pyvideotrans-v3.97/tmp/13080/132fdf2cc4/novoice.mp4', noextname='1', shibie_audio=None, targetdir_mp4='D:/360安全浏览器下载/tatai/1-mp4/1.mp4', instrument=None, vocal=None, back_audio='', background_music=None, app_mode='biaozhun', subtitle_type=4, 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', voice_autorate=False, video_autorate=True, is_cuda=False, name='D:/360安全浏览器下载/1/1.mp4', basename='1.mp4', ext='mp4', dirname='D:/360安全浏览器下载/1', shound_del_name=None, uuid='132fdf2cc4', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=0, only_out_mp4=False, fix_punc=False, recogn2pass=True)


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

1 Replies

翻译字幕时因内容过长超出DeepSeek模型的最大Token限制。

请按以下步骤调整设置:

  1. 减小单次发送内容:在软件主界面,点击 菜单 -> 工具/选项 -> 高级选项,找到“字幕翻译调整”区域。将 AI翻译渠道每批字幕行数 的值减小(例如从默认值改为 20 或更小)。
  2. 关闭“发送完整字幕”:如果当前已勾选“发送完整字幕”,请取消勾选。此选项会附带时间轴和行号,显著增加Token消耗。
  3. (可选)调整提示词:如果使用了自定义提示词,检查 prompts 目录下的文件,确保提示词本身没有过于冗长。

完成以上调整后,重新尝试翻译任务。

请查阅相关文档:

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.

Related resource