-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openai models do not complete any further requests after throwing an APITimeoutError
#428
Comments
This seems to be a problem with the OpenAI API. Check here for status: openai/openai-python#769. In the meantime we could create a client for each request. It's inefficient, but random timeouts are more annoying. |
This should be (temporarily) fixed by #434. Could you please confirm? |
I am on it. |
Great! I wrote that in the PR: Very big improvement in performance. I cannot say that it recovers after a timeout, because it doesn't timeout anymore. Workflows where before there was a 100% chance of throwing a timeout are now completed. |
I guess better wait for the PR to be merged before closing it ... |
Describe the issue as clearly as possible:
Whenever an OpenAI model throws an
APITimeoutError
retrying again won't work.For instance:
client
attribute (of classopenai.AsyncOpenAI
) and then creating a new instance of the openai model -> same problem.However, closing the client and restarting it, works. The connection recovers and often continues normally. The same "recovery" happened if you would simple re-run the script.
Btw, in order to "restart" the client, I had to change the code below
And do this in my code (quite hacky):
Maybe you have a more principled understanding of what's going on. There seems to be some issue with open connections.
Indeed, maybe the requests with openai simply time out too often.
In any case, the issue is quite recurrent and, imo, it may have appeared after the commit with the commit of adapting the code to openai sdk 1.0.0 (b60bb7a).
Maybe a fast way of dealing with this would be with a restart_client method on the openAI class.
Steps/code to reproduce the bug:
Expected result:
Error message:
No response
Outlines/Python version information:
Context for the issue:
I am getting a timeout at least once every 20 or 30 requests. Without fixing this no way of completing any sizeable batch work.
The text was updated successfully, but these errors were encountered: