-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Comments
How is your openai account looking? |
I have been registering for several months and have not recharged before |
Try again in a few hours, I think it can help |
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? |
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". |
@dbkalaria please create a PR, I will review, thank you! |
📜 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?
🔗 Are you willing to submit PR?
None
🧑⚖️ Code of Conduct
The text was updated successfully, but these errors were encountered: