#8346 prediction aborted, token repeat limit reachedTraceback (most recent call last):

94.139**0 Posted at: 3 hours ago

prediction aborted, token repeat limit reached
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 90, in run
File "videotrans\task\_stage_translate.py", line 31, in trans
File "videotrans\translator\_runner.py", line 71, in run
File "videotrans\translator\_base.py", line 85, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 90, in _item_task
File "videotrans\translator\_openaicompat.py", line 40, in _create_completion
File "openai\_utils\_utils.py", line 298, in wrapper
File "openai\resources\chat\completions\completions.py", line 1215, in create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1105, in request
openai.InternalServerError: Error code: 500 - {'error': {'message': 'prediction aborted, token repeat limit reached', 'type': 'api_error', 'param': None, 'code': None}}

trk=[TransCreate]: uuid='77333a0eef', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Users/kimnh/OneDrive/Máy tính/youtobe/Traffickers Turn a Child Into a ‘Wolf Boy’ With Asphalt yt.mp4,
输出结果保存到文件夹: C:/Users/kimnh/OneDrive/Máy tính/youtobe/_video_out/Traffickers Turn a Child Into a ‘Wolf Boy’ With Asphalt yt-mp4,
临时文件夹: C:/Users/kimnh/Downloads/win-pyvideotrans-v4.16/tmp/16500/77333a0eef
已选 清理已存在
未启用CUDA加速
未选 降噪
STT Service:faster-whisper(Built-in), large-v3-turbo, 发音语言: Simplified Chinese,
TranslateSrt:Local LLM (OpenAI-compatible),原始语言:Simplified Chinese,目标语言:English, 已选 SendSRT
TTS Service:Edge-TTS (Free), 角色:Brian(Male/US), 配音语言:English, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 已选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: No Subtitles , precent=12, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=True, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='', should_recogn2=False, do_diarize=True
video_duration_ms=912040


=
system:Windows-10-10.0.26200-SP0
version:v4.16
frozen:True
language:en_US
root_dir:C:/Users/kimnh/Downloads/win-pyvideotrans-v4.16

1 Replies

#1 DeepSeek reply at 3 hours ago

The root cause: the local OpenAI-compatible LLM returned a repetition loop and the backend aborted generation ("token repeat limit reached"). This is an AI-translation-channel failure, not an ASR/TTS problem. Small local models commonly fall into repeat loops when the batch of subtitle lines sent in one request is too large, when max output tokens are too small, or when the source subtitle text itself contains long repeated content (hallucinated repeats).

Recommended fixes, in order:

  1. Reduce the AI batch size

    • Menu → Tools/Options → Advanced Options → Translation
    • Set AI translation batch size (lines) to 1 (or 10) and retry. This is the single most effective fix for repeat-limit aborts.
  2. Verify the spoken language setting

    • Your log shows 发音语言: Simplified Chinese for a file named "Traffickers Turn a Child Into a 'Wolf Boy' With Asphalt yt.mp4". If the audio is actually English, faster-whisper will output hallucinated, heavily repeated text, which then triggers the LLM loop.
    • Set Spoken language correctly (e.g. English) and re-run with Clear Output checked.
  3. Check the recognized subtitles for repetition

    • Open the generated zh-cn.srt (or your source-language srt) in the output folder and inspect it. Any line with mass repetition (e.g. "no, no, no, no…") will almost certainly cause this error. Delete/repair those lines and continue, or re-run.
  4. Disable "Send full subtitles"

    • Uncheck SendSRT (发送完整字幕) so subtitles are submitted line-by-line as plain text. Large full-SRT prompts are the most common trigger for local-model loops.
  5. Raise the output token limit / lower randomness

    • In the Local LLM (OpenAI-compatible) settings window, increase max tokens and keep temperature low (0.1–0.3). Local 7B-class models have weak instruction-following; if it still loops, switch to DeepSeek or OpenAI, which handle the SRT prompt format reliably.
  6. If you want higher quality overall

    • Switch the translation channel to DeepSeek (very low cost) or M2M100 (built-in) for fully offline translation, and keep LLM correction enabled.

Please refer to 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