Skip to content

RateLimitError??? #9

Description

@paraoxy

Hi.

I have a free OpenAI acccount with 5$ credits of tokens. Why does this happen?? The deck size is 798 cards, help pls!!

Calculating embeddings: 0% 3/798 [00:00<02:06, 6.27it/s]Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/tenacity/init.py", line 382, in call
result = fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/openai/embeddings_utils.py", line 23, in get_embedding
return openai.Embedding.create(input=[text], engine=engine, **kwargs)["data"][0]["embedding"]
File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/embedding.py", line 33, in create
response = super().create(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 230, in request
resp, got_stream = self._interpret_response(result, stream)
File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 624, in _interpret_response
self._interpret_response_line(
File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 687, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: Rate limit reached for text-embedding-ada-002 in organization org-LZdhoFGxNKPqs8CZrSluPGUH on requests per min (RPM): Limit 3, Used 3, Requested 1. Please try again in 20s. Visit https://platform.openai.com/account/rate-limits to learn more. You can increase your rate limit by adding a payment method to your account at https://platform.openai.com/account/billing.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/content/embed_anki_deck.py", line 59, in
main()
File "/content/embed_anki_deck.py", line 53, in main
df["emb"] = calculate_embeddings(df)
File "/content/embed_anki_deck.py", line 29, in calculate_embeddings
return [get_embedding(card, engine=EMBEDDING_MODEL) for card in tqdm(df.card, desc="Calculating embeddings", dynamic_ncols=True)]
File "/content/embed_anki_deck.py", line 29, in
return [get_embedding(card, engine=EMBEDDING_MODEL) for card in tqdm(df.card, desc="Calculating embeddings", dynamic_ncols=True)]
File "/usr/local/lib/python3.10/dist-packages/tenacity/init.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "/usr/local/lib/python3.10/dist-packages/tenacity/init.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "/usr/local/lib/python3.10/dist-packages/tenacity/init.py", line 326, in iter
raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x78a303727190 state=finished raised RateLimitError>]
Calculating embeddings: 0%| | 3/798 [00:11<52:30, 3.96s/it]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions