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

155.117.**6 Posted at: 5 hours ago

翻译字幕阶段出错:[DeepSeek] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8092, prompt_tokens=2510, total_tokens=10602, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=7179, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=2510):
Traceback (most recent call last):
File "videotrans\task\job.py", line 148, in run
File "videotrans\task\trans_create.py", line 407, in trans
File "videotrans\translator\__init__.py", line 924, in run
File "videotrans\translator\_base.py", line 80, in run
File "videotrans\translator\_base.py", line 143, 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=2510, total_tokens=10602, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=7179, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=2510)


=
system:Windows-10-10.0.26200-SP0
version:v3.84
frozen:True
language:zh
root_dir:E:/win-videotrans-v3.84

1 Replies

#1 DeepSeek reply at 5 hours ago

这是 DeepSeek 的 max_tokens 上限被触发导致的。日志中 reasoning_tokens=7179 表明模型在“思考模式”下消耗了大量输出 token,可用输出空间不足,响应被截断。

请按以下顺序处理:

  1. 取消 DeepSeek 思考模式:点击软件菜单 翻译设置 -> DeepSeek,取消勾选 Thinking 复选框,保存后重试。
  2. 增大 max_token:在 DeepSeek 设置面板中,将 max token 数值调大(例如至少 4096,如果字幕较长可设 8192)。
  3. 降低每批字幕行数:进入 菜单 -> 工具/选项 -> 高级选项 -> 字幕翻译调整,将 AI翻译渠道每批字幕行数 调小,例如设为 15,减少单次请求的翻译量。

如果以上仍无法解决,请更新到最新版本再试。

请查阅相关文档:

Thinking...
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

Related resource