#7806 翻译字幕阶段出错 [兼容AI/本地模型] prediction aborted, token repeat limit reachedTraceback (most recent call last):

120.85**3 Posted at: 1 hour ago

翻译字幕阶段出错 [兼容AI/本地模型] prediction aborted, token repeat limit reached
Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

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

File "videotrans\task\_stage_translate.py", line 31, in trans

File "videotrans\translator\_runner.py", line 75, in run

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

File "tenacity\__init__.py", line 480, in call

File "videotrans\translator\_openaicompat.py", line 98, in _item_task

File "videotrans\translator\_openaicompat.py", line 48, 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}}

self.cfg=[TaskCfgVTT]当前工作模式: 转录并翻译字幕
原始输入文件名: F:/Video/my/MIDA-241/MIDA-241.H265.mp4,
输出结果保存到文件夹: F:/Video/my/MIDA-241/_video_out/MIDA-241.H265-mp4,
临时文件夹: D:/RUANJIAN/win-pyvideotrans-v4.14/tmp/1336/76839fa71a
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:Qwen-ASR(内置), 1.7B, 发音语言: 日语, 断句方式:LLM重新断句
翻译渠道:兼容AI/本地模型,原始语言:日语,目标语言:简体中文, 已选 发送完整字幕
已选 将生成的字幕复制到视频目录下
输出字幕格式: 单字幕


=
system:Windows-10-10.0.19045-SP0
version:v4.14
frozen:True
language:zh_CN
root_dir:D:/RUANJIAN/win-pyvideotrans-v4.14

1 Replies

#1 DeepSeek reply at 1 hour ago

`这是因为本地小模型(兼容AI/本地模型)指令跟随能力弱,在翻译时陷入死循环重复输出,触发了模型端 token 重复限制而被中止。

解决方案:

  1. 精简提示词:打开 软件目录/videotrans/prompts/srt/localllm.txt(你已勾选发送完整字幕,所以是srt目录下的文件),检查是否有过于复杂的要求,删减或简化,注意 {} 包裹的变量不要动。
  2. 降低单批字幕行数:进入 菜单 → 工具/选项 → 高级选项 → 字幕翻译,将 AI翻译渠道每批字幕行数 调小(如设为 1 或 3),避免单次输入过长导致模型失控。
  3. 更换模型/渠道:本地小模型(7B级)理解复杂提示词能力差,建议改用 DeepSeek 等在线旗舰大模型,或换用支持更好的本地模型。
  4. 检查原始字幕:如果原始识别出的字幕中存在大量重复文字(类似 "no,no,no,no..." 大量重复),也会导致此错误,需先修正原始字幕。

请查阅相关文档:

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