[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details. #734

Open
2 tasks done
AoooooX opened this issue Oct 30, 2023 · 7 comments
Assignees

Comments

@AoooooX
Copy link
AoooooX commented Oct 30, 2023

📜 Description

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

👟 Reproduction steps

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

👍 Expected behavior

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

👎 Actual Behavior with Screenshots

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

💻 Operating system

Windows

What browsers are you seeing the problem on?

No response

🤖 What development environment are you experiencing this bug on?

Local dev server

🔒 Did you set the correct environment variables in the right path? List the environment variable names (not values please!)

No response

📃 Provide any additional context for the Bug.

Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
docsgpt-backend-1 | Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
docsgpt-backend-1 | Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
docsgpt-backend-1 | Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 8.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
docsgpt-backend-1 | Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 10.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..
docsgpt-backend-1 | [2023-10-30 08:04:52 +0000] [7] [ERROR] Error handling request /stream
docsgpt-backend-1 | Traceback (most recent call last):
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 136, in handle
docsgpt-backend-1 | self.handle_request(listener, req, client, addr)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 184, in handle_request
docsgpt-backend-1 | for item in respiter:
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/werkzeug/wsgi.py", line 256, in next
docsgpt-backend-1 | return self._next()
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/werkzeug/wrappers/response.py", line 32, in _iter_encoded
docsgpt-backend-1 | for item in iterable:
docsgpt-backend-1 | File "/app/application/api/answer/routes.py", line 120, in complete_stream
docsgpt-backend-1 | docs = docsearch.search(question, k=2)
docsgpt-backend-1 | File "/app/application/vectorstore/faiss.py", line 22, in search
docsgpt-backend-1 | return self.docsearch.similarity_search(*args, **kwargs)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 334, in similarity_search
docsgpt-backend-1 | docs_and_scores = self.similarity_search_with_score(
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 275, in similarity_search_with_score
docsgpt-backend-1 | embedding = self.embedding_function(query)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 518, in embed_query
docsgpt-backend-1 | return self.embed_documents([text])[0]
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 490, in embed_documents
docsgpt-backend-1 | return self._get_len_safe_embeddings(texts, engine=self.deployment)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 374, in _get_len_safe_embeddings
docsgpt-backend-1 | response = embed_with_retry(
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 107, in embed_with_retry
docsgpt-backend-1 | return _embed_with_retry(**kwargs)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/init.py", line 289, in wrapped_f
docsgpt-backend-1 | return self(f, *args, **kw)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/init.py", line 379, in call
docsgpt-backend-1 | do = self.iter(retry_state=retry_state)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/init.py", line 325, in iter
docsgpt-backend-1 | raise retry_exc.reraise()
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/init.py", line 158, in reraise
docsgpt-backend-1 | raise self.last_attempt.result()
docsgpt-backend-1 | File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result
docsgpt-backend-1 | return self.__get_result()
docsgpt-backend-1 | File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
docsgpt-backend-1 | raise self._exception
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/tenacity/init.py", line 382, in call
docsgpt-backend-1 | result = fn(*args, **kwargs)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 104, in _embed_with_retry
docsgpt-backend-1 | response = embeddings.client.create(**kwargs)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_resources/embedding.py", line 33, in create
docsgpt-backend-1 | response = super().create(*args, **kwargs)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
docsgpt-backend-1 | response, _, api_key = requestor.request(
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 298, in request
docsgpt-backend-1 | resp, got_stream = self._interpret_response(result, stream)
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 700, in _interpret_response
docsgpt-backend-1 | self._interpret_response_line(
docsgpt-backend-1 | File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line
docsgpt-backend-1 | raise self.handle_error_response(
docsgpt-backend-1 | openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.

📖 Relevant log output

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🔗 Are you willing to submit PR?

None

🧑‍⚖️ Code of Conduct

  • I agree to follow this project's Code of Conduct
@dartpain
Copy link
Contributor

How is your openai account looking?
Is it newly registered?

@AoooooX
Copy link
Author
AoooooX commented Oct 31, 2023

How is your openai account looking? Is it newly registered?

I have been registering for several months and have not recharged before

@dartpain
Copy link
Contributor

Try again in a few hours, I think it can help

@dbkalaria
Copy link

Hello @AoooooX, Did you able to solve this issue. Here you are using the embeddings model to generate the embeddings for your documents. So to query on document we first need to generate the embeddings from text and store it in-memory or in the vector DB and then your query is processed against those embeddings to generate the result. If there is large content in your document data you will get the rate limit error based on your plan.

@dartpain I have already implemented this in one of my projects using async functionality. If this is still not implemented can you create a PR and assign it to me?

@AoooooX
Copy link
Author
AoooooX commented Nov 7, 2023

你好@AoooooX,你能解决这个问题吗?在这里,您使用嵌入模型来生成文档的嵌入。因此,要查询文档,我们首先需要从文本生成嵌入并将其存储在内存中或向量数据库中,然后根据这些嵌入处理您的查询以生成结果。如果您的文档数据中有大量内容,您将收到基于您的计划的速率限制错误。

@dartpain我已经在我的一个项目中使用异步功能实现了这一点。如果这仍然没有实现,你可以创建一个 PR 并将其分配给我吗?

May I ask how to embed the model

@dbkalaria
Copy link

You don't need to embed that model. It's an embedding model api from OpenAI that is used internally to convert the text to embeddings. You can check the model on OpenAI site "text embedding ada 002".

@dartpain
Copy link
Contributor

@dbkalaria please create a PR, I will review, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants