#6353 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数Could not parse response content as the length limit was reached - Complet

2409:**:1a Posted at: 3 hours ago

内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=32768, prompt_tokens=2933, total_tokens=35701, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=32768, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=2933)
Traceback (most recent call last):
File "videotrans\translator\_base.py", line 71, in run
File "videotrans\translator\_base.py", line 206, 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 421, in exc_check
tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 73, in run
File "videotrans\task\_stage_translate.py", line 31, in trans
File "videotrans\translator\_runner.py", line 63, in run
File "videotrans\translator\_base.py", line 74, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 92, in _item_task
openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=32768, prompt_tokens=2933, total_tokens=35701, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=32768, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=2933)

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: C:/Users/Administrator/Desktop/MIAB-290.mp4,
输出结果保存到文件夹: C:/Users/Administrator/Desktop/win-pyvideotrans-v4.07/MIAB-290-mp4,
临时文件夹: C:/Users/Administrator/Desktop/win-pyvideotrans-v4.07/tmp/31084/61e451ac88
已选 清理已存在
已选 启用CUDA加速
未选 降噪
语音识别:openai-whisper(本地内置), model_name: large-v3, 发音语言: 日语, 断句方式:默认断句
翻译渠道:DeepSeek,原始语言:日语,目标语言:简体中文, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕
代理地址:


=
system:Windows-10-10.0.26200-SP0
version:v4.07
frozen:True
language:zh
root_dir:C:/Users/Administrator/Desktop/win-pyvideotrans-v4.07

1 Replies

这是由于 DeepSeek 处于“思考模式”导致的:模型把全部 32768 个输出 token 都消耗在了思考(reasoning_tokens=32768)上,没有剩余 token 输出实际翻译结果,从而触发 LengthFinishReasonError

解决方案(按优先级操作):

  1. 关闭思考模式:进入 菜单 -> 翻译设置 -> DeepSeek,在设置面板中取消勾选“Thinking”(思考)复选框。这是最直接的解决办法。
  2. 增大 max_token:在同一个 DeepSeek 设置面板中,将 max token 调大(若已接近上限,请优先关闭思考模式)。
  3. 降低每批字幕行数:进入 菜单 -> 工具 -> 高级选项 -> 字幕翻译调整,将 AI翻译渠道每批字幕行数 由较大值改为 20~50,减少单次请求的输入输出长度。
  4. 取消“发送完整字幕”:可暂时取消主界面的“发送完整字幕”勾选,改用逐行翻译,减少单次请求体量。

如果你仍希望使用思考模式,则必须同时调大 max_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