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

2409:**:d1c0 Posted at: 11 hours ago

内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=65536, prompt_tokens=15424, total_tokens=80960, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=65536, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=15424)
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=65536, prompt_tokens=15424, total_tokens=80960, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=65536, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=15424)

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: F:/Video Apps/video/20260813-Could the South China Sea become the next global battleground/1080P/1080P-Could the South China Sea become the next global battleground.mp4,
输出结果保存到文件夹: F:/Video Apps/video/20260813-Could the South China Sea become the next global battleground/1080P/_video_out/1080P-Could the South China Sea become the next global battleground-mp4,
临时文件夹: F:/Video Apps/win-pyvideotrans-v4.07/tmp/11812/a070b8a9f8
已选 清理已存在
已选 启用CUDA加速
未选 降噪
语音识别:faster-whisper(本地内置), model_name: large-v3-turbo, 发音语言: 英语, 断句方式:LLM重新断句
翻译渠道:DeepSeek,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕
代理地址:


=
system:Windows-10-10.0.26200-SP0
version:v4.07
frozen:True
language:zh
root_dir:F:/Video Apps/win-pyvideotrans-v4.07

1 Replies

#1 DeepSeek reply at 11 hours ago

这是 DeepSeek 的“思考模式(Thinking/Reasoning)”消耗了大量输出 Token(日志中 reasoning_tokens=65536),导致输出长度达到上限、翻译内容被截断而报错。

解决办法按以下顺序操作:

  1. 关闭 DeepSeek 思考模式:打开 菜单 -> 翻译设置 -> DeepSeek,取消勾选 Thinking(思考模式)复选框。思考模式会额外消耗大量输出 Token,且需要更大的 max_token,否则极易被截断。
  2. 增大 max_token:在 DeepSeek 设置面板中,将 max_token 调大(例如设置为 8192 或更高)。
  3. 降低每批字幕行数:打开 菜单 -> 工具 -> 高级选项 -> 字幕翻译调整,将 AI翻译渠道每批字幕行数 调小(例如 20-50);同时确认是否勾选了 AI翻译一次性翻译所有字幕行,该选项需要极大 max_token 和超长上下文模型,如果不是必须,建议取消勾选。
  4. 若仍失败,请重启软件后重试;修改翻译渠道设置后需重新执行任务。

请查阅相关文档:

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