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

125.122**9 Posted at: 1 hour ago

Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=65536, prompt_tokens=2777, total_tokens=68313, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=2688), prompt_cache_hit_tokens=2688, prompt_cache_miss_tokens=89)
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=65536, prompt_tokens=2777, total_tokens=68313, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=2688), prompt_cache_hit_tokens=2688, prompt_cache_miss_tokens=89)

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Users/Administrator/Desktop/金牌3.mp4,
输出结果保存到文件夹: C:/Users/Administrator/Desktop/_video_out/金牌3-mp4,
临时文件夹: C://tmp/23092/8e88571226
未选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 简体中文, 断句方式:默认断句
翻译渠道:DeepSeek,原始语言:简体中文,目标语言:印度尼西亚, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Ardi(Male/ID), 配音语言:印度尼西亚, 已选 二次语音识别
音量:+0%, 语速:+0%, 未选 音频加速, 已选 视频慢速
字幕: 嵌入软字幕


=
system:Windows-10-10.0.19045-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:C:/

1 Replies

#1 DeepSeek reply at 1 hour ago

核心原因是:单次发送给 AI 翻译渠道的字幕行数过多,或原始字幕中存在大量重复文字导致模型陷入死循环,最终耗尽最大输出 token(65536)被截断,触发 LengthFinishReasonError。你的日志已明确显示 completion_tokens=65536,即翻译大模型把 token 全用满了。

解决步骤:

  1. 调小单批字幕行数:进入 菜单 → 工具/选项 → 高级选项 → 字幕翻译,将 AI翻译渠道每批字幕行数(Batch size (lines) for AI translation)改为 10 或 20。
  2. 如第1步无效,说明原字幕中有某行存在大量重复文本(例如连续几百个 "no,no,no" 或 "hey,hey"),必须打开待翻译的原始字幕文件,删除这些大量重复内容后再重试。
  3. 可同时适当调大你所用 DeepSeek 渠道设置面板里的 max tokens(最大输出token)。
  4. 重新翻译时,请勾选主界面的 清理已生成(Clear Output),避免使用上次失败留下的缓存或旧字幕。

请查阅相关文档:

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