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

111.60* Posted at: 1 day ago 👁23

Could not parse response content as the length limit was reached - CompletionUsage(completion_tokens=8092, prompt_tokens=2615, total_tokens=10707, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=6560, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=2560), prompt_cache_hit_tokens=2560, prompt_cache_miss_tokens=55)


=
system:Windows-10-10.0.26100-SP0
version:v3.85
frozen:True
language:zh
root_dir:C:/Users/~/Desktop/win-pyvideotrans-v3.85

1 Replies

这是 OpenAI API 的响应长度限制错误,通常发生在使用 GPT-4 等模型进行翻译时,翻译内容过长导致超出 token 限制。

请按以下步骤解决:

  1. 减少单次翻译量:在菜单栏选择 工具/选项 -> 高级选项,在"字幕翻译调整"区域,将"同时翻译字幕数"设置为较小的值(如 5-10 行),避免一次性发送过多内容。
  2. 使用更经济的模型:如果当前使用的是 GPT-4,建议切换到 GPT-3.5-turbo 或其他 token 消耗更少的模型。
  3. 简化翻译内容:如果字幕文件特别长,考虑先进行预处理,删除不必要的重复内容或缩短过长的句子。
  4. 分批处理:对于超长视频,可以分段处理,或者使用软件的批量串行功能。
  5. 检查网络代理:确保代理设置正确,避免因网络问题导致的重复请求和 token 浪费。

如果问题持续存在,建议改用本地翻译模型如 Google 翻译,或使用其他在线翻译服务如 DeepSeek、Gemini 等。

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