I created a Python script that loops through a list of text strings (each string is about 2000 characters in length) and summarizes each string. See the code for the response below (This prompt is within a for loop):
response = openai.Completion.create( model="text-davinci-003", max_tokens=2000, prompt = f"Summarize the following text: {text_list[i]}", temperature=0.5, frequency_penalty=1.5, presence_penalty=-1.5, n=1 )
It works for maybe 1 or 2 items in the text list but then I receive an error: “openai.error.APIError: The server had an error while processing your request. Sorry about that!”
This happens consistently even when I use different api keys, prompts, accounts. Any idea what is happening?
When you loop and post to the OpenAI, you will get these errors if you do not slow down the loop.
Normally, when I loop while posting to the OpenAI API, I use a 2 second delay in the loop; but I think one second is OK. Without any delay, you will get an error.
I’m using 5-second sleep, and it just happened to me multiple times just now. I did make about 300 requests yesterday - don’t know if it had anything to do with that. Other than that, I just get this error when trying and had to add it to the try, exception statements: openai.error.RateLimitError: The server had an error while processing your request. Sorry about that!
Also, I notice that this thread was dead for 14 days, but around 30 minutes ago, the same time this error occurred to me, someone new posted that this error is showing up. This makes me think that it’s happening to more than one of us right now.