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

106.16**3 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=5570, total_tokens=38338, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=1024), prompt_cache_hit_tokens=1024, prompt_cache_miss_tokens=4546)
Traceback (most recent call last):
File "videotrans\translator\_base.py", line 71, in run
File "videotrans\translator\_base.py", line 204, 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 87, in run
File "videotrans\task\_stage_translate.py", line 31, in trans
File "videotrans\translator\_runner.py", line 68, 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 99, in _item_task
openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=32768, prompt_tokens=5570, total_tokens=38338, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=1024), prompt_cache_hit_tokens=1024, prompt_cache_miss_tokens=4546)

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: D:/ike/新建文件夹/ldP2.mp4,
输出结果保存到文件夹: D:/ike/ldP2-mp4,
临时文件夹: E:/ike/win-pyvideotrans-v4.08-0802/tmp/17272/7a5a7a73b5
已选 清理已存在
未启用CUDA加速
未选 降噪
已选 识别说话人,最大说话人数量不限制
已选 删除所有标点符号
语音识别:阿里百炼API/Qwen3-ASR, , 发音语言: 英语, 断句方式:默认断句
翻译渠道:DeepSeek,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕(双) 目标语言在上双字幕
已选 仅输出mp4


=
system:Windows-10-10.0.22621-SP0
version:v4.09
frozen:True
language:zh
root_dir:E:/ike/win-pyvideotrans-v4.08-0802

1 Replies

#1 DeepSeek reply at 3 hours ago

这是 DeepSeek 翻译渠道在翻译字幕时,一次性发送了过多字幕行,导致模型输出 token 达到上限(completion_tokens=32768)而中断。

解决方法(按顺序操作):

  1. 降低每批翻译的字幕行数

    • 打开顶部菜单:菜单 → 工具/选项 → 高级选项
    • 找到字幕翻译调整,将 AI翻译渠道每批字幕行数 从默认值调小(建议设为 51
    • 同时取消勾选AI翻译一次性翻译所有字幕行
  2. 增大 DeepSeek 的 max_token

    • 打开菜单 → 翻译设置 → DeepSeek
    • max_token 值调大(例如设置为 819216384
    • 如果 DeepSeek 设置中有Thinking模式,建议取消勾选,否则思考模式会消耗大量 token
  3. 保存设置后重新执行翻译

如果仍出现同样报错,请继续减小AI翻译渠道每批字幕行数1,或改用更短的文本分批翻译。

请查阅相关文档:

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