2

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. I have also tried exponential backoff with no success. Any idea what is happening?

Rok Benko
  • 14,265
  • 2
  • 24
  • 49
sotired
  • 61
  • 1
  • 7
  • I'm seeing the same thing. It never used to do this. I filed a couple of bug reports but they seem to have gone into a black hole. – Toby Hobson Feb 04 '23 at 10:52

1 Answers1

1

All 5xx status codes mean server error. The problem is caused by OpenAI servers. Whether you get error 500, 503 or 504, it is not your fault.

List of HTTP status codes:

  • 1xx informational response
  • 2xx success
  • 3xx redirection
  • 4xx client errors
  • 5xx server errors

Note: You can check OpenAI status here.

Rok Benko
  • 14,265
  • 2
  • 24
  • 49