#7430 Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=16384, prompt_token

2a10**1075 Posted at: 2 hours ago

Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=16384, prompt_tokens=6754, total_tokens=23138, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=16384, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=6754)
Traceback (most recent call last):
File "videotrans\translator\_base.py", line 70, in run
File "videotrans\translator\_base.py", line 153, 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 89, in run
File "videotrans\task\_stage_translate.py", line 31, in trans
File "videotrans\translator\_runner.py", line 67, in run
File "videotrans\translator\_base.py", line 73, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 104, in _item_task
openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=16384, prompt_tokens=6754, total_tokens=23138, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=16384, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0), prompt_cache_hit_tokens=0, prompt_cache_miss_tokens=6754)

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: E:/Downloads/Video/翻译测试.mp4,
输出结果保存到文件夹: E:/Downloads/Video/_video_out/翻译测试-mp4,
临时文件夹: E:/win-pyvideotrans-v4.12-0913/tmp/22184/e2343f9fdf
已选 清理已存在
已启用CUDA加速
已选 降噪
已选 识别说话人,最大说话人数量不限制
语音识别:Faster-Whisper-XXL.exe, large-v3, 发音语言: 泰国语, 断句方式:默认断句
翻译渠道:DeepSeek,原始语言:泰国语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunyang(Male/CN), 配音语言:简体中文, 已选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: 嵌入软字幕
已选 分离人声与背景声,存在分离后的纯净人声文件,存在分离后的背景声音文件
代理地址:http://127.0.0.1:7897
video_duration_ms=930100


=
system:Windows-10-10.0.26200-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:E:/win-pyvideotrans-v4.12-0913

1 Replies

#1 DeepSeek reply at 2 hours ago

这是AI翻译渠道(DeepSeek)返回内容超出模型最大输出长度限制导致的报错(LengthFinishReasonError),根因是发送了过长/过多的字幕内容,导致模型输出被截断

从你的日志看:prompt_tokens=6754completion_tokens=16384(已达上限),reasoning_tokens=16384。这说明模型把所有输出预算都消耗在"思考(reasoning)"上,正式翻译内容根本没输出完就被截断。

解决方案(按顺序操作)

  1. 关闭思考模式
    进入 菜单 → 翻译设置 → DeepSeek,取消勾选 Thinking(思考模式)。DeepSeek 的思考模式会大量消耗 token,极易触发此错误。
  2. 减少每批发送的字幕行数
    进入 菜单 → 工具/选项 → 高级选项 → 字幕翻译,将 AI翻译渠道每批字幕行数 从当前值(可能100+)调小,例如改为 20 或更小
  3. 取消"发送完整字幕"
    主界面翻译渠道区域,取消勾选 发送完整字幕,改用逐行翻译模式,避免一次性提交过长内容。
  4. 谨慎使用"AI翻译附带所有字幕做参考"
    进入 菜单 → 工具/选项 → 高级选项 → 字幕翻译,若勾选了 AI翻译附带所有字幕做参考 请取消。该选项会附带全部原始字幕(你这里有930秒视频的字幕量),大幅增加 prompt 和输出长度,极易超出模型限制。
  5. 更换/检查模型
    确认所用 DeepSeek 模型名称正确。可改用 deepseek-chat 等非思考模式模型进行翻译。
补充说明:你的视频时长 930 秒(约15分钟),字幕批次数较多,建议第2、4步务必执行。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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