当前位置: 首页 > news >正文

Getting RateLimitError while implementing openai GPT with Python

题意:“在使用 Python 实现 OpenAI GPT 时遇到 RateLimitError 错误。”

问题背景:

I have started to implement openai gpt model in python. I have to send a single request in which I am getting RateLimitError.

“我开始在 Python 中实现 OpenAI GPT 模型。发送单个请求时遇到了 RateLimitError 错误。”

My code looks like this        我的代码类似如下

import openaikey = '<SECRET-KEY>'
openai.api_key = key
model_engine = 'text-ada-001'
prompt = 'Hi, How are you today?'
completion = openai.Completion.create(engine=model_engine, prompt=prompt, max_token=2048, n=1, stop=None, temprature=0.5)
print(completion.choices)

This is what error I am getting        我得到的错误信息如下

openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.

So, How do I do development without getting this error? I have checked the doc they provide a free version with limitations but this is the initial stage I have sent only 5-6 requests in an hour.

“那么,我该如何在不出现此错误的情况下进行开发?我查看了文档,他们提供了一个有限制的免费版本,但这是初始阶段,我每小时只发送了 5-6 个请求。”

Thanks advance for your help.        “提前感谢您的帮助。”

问题解决:

Later versions (>= 1.0.0) of the openai Python API include functionality to automatically retry requests. See GitHub discussion.

“较新版本(>= 1.0.0)的 OpenAI Python API 包含自动重试请求的功能。请参见 GitHub 讨论。”


http://www.mrgr.cn/news/12752.html

相关文章:

  • Android 12系统源码_输入系统(二)InputManagerService服务架构
  • input中文输入频繁触发input方法问题
  • Open3D编译安装
  • 前端数据爬虫之puppeteer
  • 如何实现对象克隆
  • 深入理解Vue的beforeDestroy钩子函数及其实际应用
  • 通过历史进行数据预测的算法
  • layui2.9 树组件默认无法修改节点图标,修改过程记录下
  • TCP系列相关内容
  • 一个很好用的idea插件RestfulTookit-fix
  • Linux的多线程
  • STM32学习笔记3---ADC,DMA
  • spingboot实现常规增删改查
  • AI学习记录 - 怎么理解 torch 的 nn.Conv2d
  • 项目中Redis常见的一些问题(缓存穿透,缓存雪崩,内存耗尽等)
  • 网安面试过程中的近源攻击
  • 华为OD机试 - 找单词 - 深度优先搜索DFS(Java 2024 E卷 100分)
  • 苹果M4芯片Mac全面曝光 或10月发布
  • 说说重载(Overloading)与重写(Overriding)的区别
  • APP、小程序对接聚合广告平台需要提供哪些资料?