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

116.10.**5 Posted at: 1 day ago

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

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: F:/LosslessCutWork/test_1.mp4,
输出结果保存到文件夹: E:/EN_Video/test/test_1-mp4,
临时文件夹: D:/pytran/tmp/8616/d1d9b71997
已选 清理已存在
未启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), model_name: large-v3-turbo, 发音语言: 英语, 断句方式:默认断句
翻译渠道:硅基流动,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunyang(Male/CN), 配音语言:简体中文, 未选 二次语音识别
音量:+30%, 语速:+25%, 未选 音频加速, 已选 视频慢速
字幕: 嵌入硬字幕(双) 目标语言在上双字幕
代理地址:


=
system:Windows-10-10.0.26200-SP0
version:v4.08
frozen:True
language:zh
root_dir:D:/pytran

1 Replies

这是AI模型在翻译时输出达到设置的 max_token 上限被截断导致的(日志中 completion_tokens=8192 即输出已达8192 token限制)。因为你开启了“发送完整字幕”,系统可能将整份字幕一次性发给模型,生成内容过多超出了最大输出长度。

解决方案(按优先级操作):

  1. 进入 菜单 → 翻译设置 → 硅基流动,将 max_token 从默认值调大,例如设为 1600032000(需确认所选模型支持该输出上限)。
  2. 若仍报错,请到 菜单 → 工具 → 高级选项 → 字幕翻译调整,将 AI翻译渠道每批字幕行数 调小(如 20~50),或在主界面翻译渠道处 取消勾选“发送完整字幕”,改为按行分批翻译。
  3. 如果以上仍无效,建议升级到最新补丁/v4.09版本,某些模型渠道对长输出的处理已优化。

请查阅相关文档:

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

Dondate via PayPal

Related resource