#4395 TaskCfgSTS(is_cuda=False, uuid='3d0e0e2cdd', cache_folder=None, target_dir='J:/YouTube/DIY', source_language=None, sourc

14.153* Posted at: 7 hours ago 👁10

翻译字幕阶段出错 [兼容AI/本地模型] 内容太长超出最大允许Token,请减小内容或增大max_token,或者降低每次发送字幕行数
Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=4096, prompt_tokens=3026, total_tokens=7122, completion_tokens_details=None, prompt_tokens_details=None)


=
system:Windows-10-10.0.26200-SP0
version:v3.99
frozen:True
language:zh

1 Replies

这是因为发送给AI翻译模型的字幕总长度超过了该模型允许的最大Token数(max_tokens),导致响应被截断。您当前使用的“兼容AI/本地模型”渠道的max_tokens限制为4096,而本次请求的prompt_tokens+completion_tokens已达7122个。

解决方案(按推荐顺序):

  1. 减少每次发送的字幕行数:打开 菜单 → 工具/选项 → 高级选项 → 字幕翻译调整,将 “AI翻译渠道每批字幕行数” 从当前值降低(例如设为 10 或 20),以减少单次请求的Token占用。
  2. 增加本地模型的 max_tokens 配置:如果您部署的是本地大模型(如Ollama、vLLM等),请在启动模型服务时增大 max_tokens 参数(例如设为 8192 或更高),并确保服务端点已生效。
  3. 关闭“发送完整字幕”:在主界面或高级选项中取消勾选 “发送完整字幕”,避免一次性发送含时间轴的完整SRT格式,改用按行翻译模式。
  4. 分割字幕文件:如果字幕行数很多,可先在外部工具中将SRT文件拆分为较小片段,再分批翻译。

完成上述调整后,请重新执行翻译任务。

请查阅相关文档:

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.

Related resource