gpt_academic icon indicating copy to clipboard operation
gpt_academic copied to clipboard

RuntimeError: OpenAI拒绝了请求

Open CGUO00 opened this issue 1 year ago • 1 comments

Class | 类型

函数插件

Feature Request | 功能请求

在使用插件分析一个cpp项目时,可能时因为cpp项目文件过多,调用API过于频繁,就会导致报错。 提示如下:RuntimeError: OpenAI拒绝了请求:{"code":429,"error":"rate limit exceeded\n"}。 也有可能本人使用的是copilot学生认证的API速率限制较低,希望开发者大佬们能给点指导,是否能限制函数插件调用api接口的速率。 image

CGUO00 avatar Apr 20 '24 07:04 CGUO00

Hi,

请查看

https://github.com/binary-husky/gpt_academic/blob/ae4407135db8a8910755cf6895cf90037b651d34/config.py#L67-L69

binaryYuki avatar Apr 20 '24 12:04 binaryYuki

您好,十分感谢您的解答,但我在config文件中设置的默认访问线程数3,并没有变动,我觉得在使用批量分析整个cpp项目函数插件处理大量的cpp项目文件时,应该并没有触发线程数上限,而是可能达到了单位时间内token字节数量的限制,如果是这种原因该如何避免,同时我也会将访问线程数将为2或1再次尝试,再次感谢您的解答。


From: @.*** @.> on behalf of Yuki @.> Sent: Saturday, April 20, 2024 8:10 PM To: binary-husky/gpt_academic @.> Cc: Liu Chen @.>; Author @.***> Subject: Re: [binary-husky/gpt_academic] RuntimeError: OpenAI拒绝了请求 (Issue #1726)

Hi,

请查看

https://github.com/binary-husky/gpt_academic/blob/ae4407135db8a8910755cf6895cf90037b651d34/config.py#L69

― Reply to this email directly, view it on GitHubhttps://github.com/binary-husky/gpt_academic/issues/1726#issuecomment-2067654342, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUJTMTTJEHV6NHQZ6YFM3MLY6JLLPAVCNFSM6AAAAABGQIPHKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXGY2TIMZUGI. You are receiving this because you authored the thread.Message ID: @.***>

CGUO00 avatar Apr 21 '24 07:04 CGUO00

不好意思 请确认一下您用的是逆向的 copilot吗?Copilot 不支持并发吧?

代码这块在 https://github.com/binary-husky/gpt_academic/blob/09990d44d3bee0e391e1577887de492742d39576/crazy_functions/crazy_utils.py#L158-L173

https://github.com/binary-husky/gpt_academic/blob/09990d44d3bee0e391e1577887de492742d39576/crazy_functions/%E8%A7%A3%E6%9E%90%E9%A1%B9%E7%9B%AE%E6%BA%90%E4%BB%A3%E7%A0%81.py#L52-L103

binaryYuki avatar Apr 21 '24 14:04 binaryYuki

DEFAULT_WORKER_NUM 改成 1 试试,也不需要只看openai的模型

binary-husky avatar Apr 22 '24 08:04 binary-husky