#1093 Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=4096, prompt_tokens

120.231* Posted at: 2 days ago 👁14

Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=4096, prompt_tokens=3548, total_tokens=7644, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=5))


=
system:Windows-10-10.0.19045-SP0
version:v3.82
frozen:False
language:zh
root_dir:D:/AI/videotrans_main/pyvideotrans
Python: 3.10.4 (main, May 28 2022, 20:04:37) [MSC v.1929 64 bit (AMD64)]

1 Replies

这个错误提示表明您在使用AI翻译功能时,OpenAI API的回复内容长度超过了token限制(4096个token)。这通常发生在翻译长文本或字幕行数过多时。

请尝试以下解决方案:

  1. 减少单次翻译量

    • 在菜单栏选择 工具/选项 -> 高级选项
    • 在"翻译调整"区域,将"同时翻译的字幕数"设置为 1
    • 取消勾选"发送完整字幕"
  2. 优化翻译设置

    • 在翻译设置中,尝试使用其他翻译渠道,如 Google、Microsoft 或 DeepSeek
    • 如果必须使用OpenAI,可以考虑使用GPT-4模型(如果可用),它通常有更高的token限制
  3. 分割处理

    • 如果视频较长,可以先将视频分割成较短的片段分别处理

这些调整应该能解决token超限的问题。如果问题持续存在,请提供完整的日志文件以便进一步分析。

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.

Donate: https://ko-fi.com/jianchang512

Similar issues already exist

Trending Questions