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

103.151.**9 Posted at: 3 hours ago

翻译字幕阶段出错:[DeepSeek] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8091, prompt_tokens=825, total_tokens=8916, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=8091, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=512), prompt_cache_hit_tokens=512, prompt_cache_miss_tokens=313):
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=8091, prompt_tokens=825, total_tokens=8916, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=8091, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=512), prompt_cache_hit_tokens=512, prompt_cache_miss_tokens=313)


=
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 3 hours ago

这是DeepSeek模型返回内容超出max_token限制导致的。从日志可见 completion_tokens=8091,其中 reasoning_tokens=8091,说明 DeepSeek 使用了“思考模式”,消耗了大量 token 后达到上限而被截断。

请按以下步骤操作:

  1. 取消 DeepSeek 思考模式菜单 → 翻译设置 → DeepSeek,取消勾选 Thinking(思考模式)。思考模式下会消耗大量 token,且需要非常高的 max_token 才能容纳完整输出。
  2. 增大 DeepSeek 的 max_token:在 DeepSeek 设置面板中,将 max token 调大(建议不低于 8192;若仍想使用思考模式,建议至少 16384)。
  3. 降低每批翻译字幕行数菜单 → 工具 → 高级选项 → 字幕翻译调整,将 AI翻译渠道每批字幕行数 从当前值降低,例如设为 10 或 5。如果勾选了“AI翻译一次性翻译所有字幕行”,请取消勾选。
  4. 关闭“发送完整字幕”:若仍报错,可在同一处取消勾选 发送完整字幕,强制逐行提交翻译,避免一次输出过长。
  5. 修改后重新执行翻译任务。

请查阅相关文档:

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