-
Notifications
You must be signed in to change notification settings - Fork 245
Async calls do synchronous sleeping while waiting for predictions. #229
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
Comments
#225 fixes this partly, wanted to note that That is called from |
Hi @LucasSwitz and @rohan-mehta. Thanks for reporting this. I just opened #230, which should address this. Please take a look and let me know if that works as expected. |
Resolves #229 --------- Signed-off-by: Mattt Zmuda <[email protected]>
This is now available in version 0.23.1. |
Resolves #229 --------- Signed-off-by: Mattt Zmuda <[email protected]>
Resolves #229 --------- Signed-off-by: Mattt Zmuda <[email protected]>
It looks like the replicate client is synchronously waiting for predictions to finish during async methods.
replicate_client.async_run eventually calls this function that waits on the prediction: https://github.com/replicate/replicate-python/blob/main/replicate/run.py
prediction.wait() looks to be a synchronously spinning function: https://github.com/replicate/replicate-python/blob/main/replicate/prediction.py#L122
Am I understanding this correctly? Can we add a prediction.async_wait() that uses asyncio.wait() instead of time.sleep().
The text was updated successfully, but these errors were encountered: