GaiZhenbiao / ChuanhuChatGPT

GUI for ChatGPT API and many LLMs. Supports agents, file-based QA, GPT finetuning and query with web search. All with a neat UI.
https://huggingface.co/spaces/JohnSmith9982/ChuanhuChatGPT
GNU General Public License v3.0
15.12k stars 2.28k forks source link

[本地部署]: openai API确定有额度 为啥还会一直提示 You exceeded your current quota, please check your plan and billing details #918

Closed yuwojiusi closed 10 months ago

yuwojiusi commented 10 months ago

是否已存在现有反馈与解答?

是否是一个代理配置相关的疑问?

错误描述

openai API确定有额度 为啥还会一直提示 You exceeded your current quota, please check your plan and billing details

复现操作

1.正常部署完 2.尝试在对话框中提问

错误日志

openai.error.InvalidRequestError: The model `gpt-4` does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.
2023-10-16 13:23:04,085 [INFO] [base_model.py:490] 回答为:The model `gpt-4` does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.
2023-10-16 13:23:20,572 [INFO] [models.py:51] 正在加载OpenAI Instruct模型: gpt-3.5-turbo-instruct
2023-10-16 13:23:20,577 [INFO] [models.py:121] 模型设置为了: gpt-3.5-turbo-instruct
2023-10-16 13:23:28,603 [INFO] [base_model.py:424] 用户admin的输入为:java之父
2023-10-16 13:23:28,605 [WARNING] [base_model.py:232] stream predict not implemented, using at once predict instead
2023-10-16 13:23:31,068 [INFO] [util.py:67] error_code=insufficient_quota error_message='You exceeded your current quota, please check your plan and billing details.' error_param=None error_type=insufficient_quota message='OpenAI API error received' stream_error=False
Traceback (most recent call last):
  File "/Users/wangxiao/www/GPT/ChuanhuChatGPT-main/modules/models/base_model.py", line 473, in predict
    for chatbot, status_text in iter:
  File "/Users/wangxiao/www/GPT/ChuanhuChatGPT-main/modules/models/base_model.py", line 282, in stream_next_chatbot
    for partial_text in stream_iter:
  File "/Users/wangxiao/www/GPT/ChuanhuChatGPT-main/modules/models/base_model.py", line 234, in get_answer_stream_iter
    response, _ = self.get_answer_at_once()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/wangxiao/www/GPT/ChuanhuChatGPT-main/modules/models/OpenAIInstruct.py", line 19, in get_answer_at_once
    response = openai.Completion.create(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/wangxiao/www/GPT/ChuanhuChatGPT-main/venv/lib/python3.11/site-packages/openai/api_resources/completion.py", line 25, in create
    return super().create(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/wangxiao/www/GPT/ChuanhuChatGPT-main/venv/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 155, in create
    response, _, api_key = requestor.request(
                           ^^^^^^^^^^^^^^^^^^
  File "/Users/wangxiao/www/GPT/ChuanhuChatGPT-main/venv/lib/python3.11/site-packages/openai/api_requestor.py", line 299, in request
    resp, got_stream = self._interpret_response(result, stream)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/wangxiao/www/GPT/ChuanhuChatGPT-main/venv/lib/python3.11/site-packages/openai/api_requestor.py", line 710, in _interpret_response
    self._interpret_response_line(
  File "/Users/wangxiao/www/GPT/ChuanhuChatGPT-main/venv/lib/python3.11/site-packages/openai/api_requestor.py", line 775, in _interpret_response_line
    raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.

运行环境

- OS: macos
- Browser: 
- Gradio version: 
- Python version:  3.11.6

补充说明

No response

GaiZhenbiao commented 10 months ago

可能是余额过期了?

yuwojiusi commented 10 months ago

我今天刚买的账号,也充值了,在其他项目中可以正常使用这个key,gpt4和3.5都试过,郁闷了

yuwojiusi commented 10 months ago
截屏2023-10-16 14 36 42
GaiZhenbiao commented 10 months ago

GPT 3.5和 4 都也不行吗

yuwojiusi commented 10 months ago

是的 都不行

yuwojiusi commented 10 months ago
截屏2023-10-16 14 54 24
GaiZhenbiao commented 10 months ago

这个报错的意思就是余额不足,我们应该没什么能做的🤔不过你说别的项目可以用,那么可以检查下 API Key 有没有填错?重启下服务器?

yuwojiusi commented 10 months ago

嗯这些我都已经尝试过了。请问下本地部署正常的操作步骤就是配置config.json 这个文件对吧,只要把里面的api_key填上我们自己的key就行了是吧,其他的需要配置吗?代理我也配置了的

GaiZhenbiao commented 10 months ago

是的,就是这样。如果还是不行,你可以把 key 发给我,我再测试下:chefs-vernier.0q@icloud.com

yuwojiusi commented 10 months ago

感谢 发了,邮箱是249238908@qq.com,邮件标题:git上提问的用户名yuwojiusi

GaiZhenbiao commented 10 months ago

我试了下可以用哇,3.5、4、instruct 都可以。你可以在 UI 里填写 API Key 再试试(点击左下角的齿轮)。试着重启下服务器?配置文件在服务器重启后生效。

yuwojiusi commented 10 months ago

我晕,真是在UI界面里设置了 才能使用,感谢

yuwojiusi commented 10 months ago

那是不是一个bug,在UI上每次切换模型的时候,key就会变成默认的。。

GaiZhenbiao commented 10 months ago

并不是必须在 UI 里设置,你的配置文件里的 key 应该是不对的/没有。你按 Ctrl S 了没?

yuwojiusi commented 10 months ago

按了的,一开始我就怀疑写错了,来回对照好几遍