developer
developer copied to clipboard
Rate limit reached
i am receiving this error when trying to run with modal:
openai.error.RateLimitError: Rate limit reached for default-gpt-3.5-turbo in organization org-o8pnXYMZiNBFvGP0dQH0exyg on requests per min. Limit: 3 / min. Please try again in 20s.
I am getting a similar error
I reached this error as well, but using GPT4 with 4000 tokens/min rate limit reached
I got the same issue, fixed it by minor code adjustment
+import time
- for filename, filecode in generate_file.map(
- list_actual, order_outputs=False, kwargs=dict(filepaths_string=filepaths_string, shared_dependencies=shared_dependencies, prompt=prompt)
- ):
- write_file(filename, filecode, directory)
+ for actual in list_actual:
+ filename, filecode = generate_file(actual, filepaths_string=filepaths_string, shared_dependencies=shared_dependencies, prompt=prompt)
+ write_file(filename, filecode, directory)
+ time.sleep(30) # wait for 30 seconds
so it just wait 30 seconds between API calls
Got the issue as well. Would be good with some config parameter as a measure against this.
+import time
for filename, filecode in generate_file.map(
list_actual, order_outputs=False, kwargs=dict(filepaths_string=filepaths_string, shared_dependencies=shared_dependencies, prompt=prompt)
):
write_file(filename, filecode, directory)
for actual in list_actual:
filename, filecode = generate_file(actual, filepaths_string=filepaths_string, shared_dependencies=shared_dependencies, prompt=prompt)
write_file(filename, filecode, directory)
time.sleep(30) # wait for 30 seconds
Where exactly did you put this?
import time goes at the top with the other imports line 175 in main.py
Awesome I can confirm that adding this delay made the rate limit error disappear. I am using gpt4
thanks guys, i will try to solve this rate limit issue at the library level