developer icon indicating copy to clipboard operation
developer copied to clipboard

Rate limit reached

Open alasharim opened this issue 1 year ago • 7 comments

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.

alasharim avatar May 25 '23 23:05 alasharim

I am getting a similar error

ether8unny avatar May 26 '23 07:05 ether8unny

I reached this error as well, but using GPT4 with 4000 tokens/min rate limit reached

ZachHandley avatar May 26 '23 20:05 ZachHandley

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

MohHeader avatar May 27 '23 12:05 MohHeader

Got the issue as well. Would be good with some config parameter as a measure against this.

meadow-kun avatar May 27 '23 12:05 meadow-kun

+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?

teknightstick avatar May 27 '23 23:05 teknightstick

import time goes at the top with the other imports line 175 in main.py

brucemeek avatar May 28 '23 00:05 brucemeek

Awesome I can confirm that adding this delay made the rate limit error disappear. I am using gpt4

teknightstick avatar May 28 '23 02:05 teknightstick

thanks guys, i will try to solve this rate limit issue at the library level

swyxio avatar May 30 '23 01:05 swyxio