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

116.76**5 Posted at: 1 hour ago

Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=65532, prompt_tokens=81911, total_tokens=147443, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=896), prompt_cache_hit_tokens=896, prompt_cache_miss_tokens=81015)
Traceback (most recent call last):
File "videotrans\translator\_base.py", line 71, in run
File "videotrans\translator\_base.py", line 154, 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 74, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 107, in _item_task
openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=65532, prompt_tokens=81911, total_tokens=147443, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=896), prompt_cache_hit_tokens=896, prompt_cache_miss_tokens=81015)

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Users/ak_tj/Downloads/SNEAKO x Professor Jiang IRL Stream in NYC.mp4,
输出结果保存到文件夹: C:/Users/ak_tj/Downloads/_video_out/SNEAKO x Professor Jiang IRL Stream in NYC-mp4,
临时文件夹: D:/win-pyvideotrans-v4.12/tmp/22376/5ff86df991
已选 清理已存在
已启用CUDA加速
已选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 英语, 断句方式:默认断句
翻译渠道:DeepSeek,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Index-TTS(本地API), 角色:clone, 配音语言:简体中文, 未选 二次语音识别
音量:+0%, 语速:-27%, 未选 音频加速, 已选 视频慢速
字幕: 嵌入硬字幕


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

1 Replies

#1 DeepSeek reply at 1 hour ago

核心原因:你勾选了「发送完整字幕」,导致一次性把整段视频的全部字幕(81200 tokens)发给了 DeepSeek,超出了模型最大输出长度(65532 tokens)限制,翻译被截断报错。

解决方案(按顺序操作)

  1. 进入高级选项菜单 → 工具/选项 → 高级选项 → 字幕翻译调整
  2. 取消勾选「发送完整字幕」,改为逐行/分批翻译模式
  3. 将「AI翻译渠道每批字幕行数」设为 20~50(不要设太大,避免再次超长)
  4. 顺带取消「AI翻译附带所有字幕做参考」(若已勾选,同样会撑爆上下文)
  5. 如果仍希望获得更好的翻译质量,建议:

    • 高级选项 → 通用设置 → LLM纠错每批字幕行数 也设为较小值(如 20)
    • 或改用 DeepSeekdeepseek-v4-flash 模型(上下文更大,但也要控制批次行数)
  6. 保存后重新执行任务

补充说明

  • 你启用了「视频慢速」但未启用「音频加速」,且勾选「嵌入硬字幕」+「降噪」,这些都会显著增加处理时间,但不影响本次报错
  • 报错中的 prompt_tokens=81911 说明翻译请求本身就极大,务必减小单次发送字幕量。

请查阅相关文档:

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