#6996 Error during subtitle translation stage [CompatibleAI/LocalModel] Could not parse response content as the length limit w

2601**a171 Posted at: 1 hour ago

Error during subtitle translation stage [CompatibleAI/LocalModel] Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=1024, prompt_tokens=533, total_tokens=1557, completion_tokens_details=None, prompt_tokens_details=None)
Traceback (most recent call last):

File "videotrans\translator\_base.py", line 71, in run

File "videotrans\translator\_base.py", line 209, 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\job.py", line 35, in run

File "videotrans\task\job.py", line 137, in process_task

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 105, in _item_task

openai.LengthFinishReasonError: Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=1024, prompt_tokens=533, total_tokens=1557, completion_tokens_details=None, prompt_tokens_details=None)
[TransCreate]翻译视频: self.is_copy_video=True,self.video_codec_num=264,self.is_audio_trans=False,self.video_info={'video_fps': 23.976023976023978, 'r_frame_rate': 23.976023976023978, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 426, 'height': 240, 'time': 33575, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}
[TaskCfgVTT]当前工作模式: 转录并翻译字幕
原始输入文件名: C:/Users/Francis/Videos/minions_true_clone.mp4,
输出结果保存到文件夹: C:/Users/Francis/Videos/_video_out/minions_true_clone-mp4,
临时文件夹: C:/AIDubbingSuite/Apps/pyVideoTrans/tmp/6728/7cf5c23a25
已选 清理已存在
已启用CUDA加速
未选 降噪
STT Service:faster-whisper(Built-in), large-v3, 发音语言: English, 断句方式:默认断句
TranslateSrt:CompatibleAI/LocalModel,原始语言:English,目标语言:Vietnamese, 已选 SendSRT
SubFormat: 单字幕


=
system:Windows-10-10.0.19045-SP0
version:v4.11
frozen:True
language:en
root_dir:C:/AIDubbingSuite/Apps/pyVideoTrans

1 Replies

#1 DeepSeek reply at 1 hour ago

The root cause is that your AI subtitle translation request hit the maximum token limit (max_tokens=1024) set for the CompatibleAI/LocalModel channel. The model's response was truncated at 1024 completion tokens, so the software couldn't parse a complete translation.

Solutions

  1. Increase the max_tokens value for your AI channel

    • Go to 菜单 → 翻译设置 and open the settings for the CompatibleAI/LocalModel channel you are using.
    • Find the max_tokens field and set it to a much larger value (e.g. 4096 or higher). This is the most direct fix.
  2. Reduce the number of subtitle lines sent per batch

    • Go to 菜单 → 工具/选项 → 高级选项 → 字幕翻译调整.
    • Set AI翻译渠道每批字幕行数 to a smaller value (e.g. 20 or 10). Sending fewer lines per request reduces the amount of output required, avoiding the token cap.
  3. Disable "AI翻译一次性翻译所有字幕行" if it is enabled

    • In the same advanced options panel, uncheck AI翻译一次性翻译所有字幕行. This option sends the entire subtitle file in one request and requires a very large max_tokens; unless you are using a flagship model with a generous token limit, it will frequently fail this way.

After making these changes, retry the translation. If the error persists, also check the CompatibleAI/LocalModel channel's "max token" setting again — some local models or relay services have a hard server-side limit that you cannot override from the client.

Please consult the relevant documentation:

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