SIGN IN SIGN UP

Bug fixes for the `wait` option in `replicate.run` (#315)

There were a couple of small bugs in the current implementation:

1. We would pass non-boolean, non-integer values through to `predictions.create` when it was an object with an interval, resulting in the blocking mode being used accidentally.
2. We would pass the boolean/integer values through to `wait` which would create a runtime error when the `wait` function expects an object.
3. We continued to poll for the prediction despite the blocking response returning the output data.

This PR addresses these three issues by checking if the run should be blocking and passing the correct arguments in the correct places. We also assume that if the returned prediction is not in `starting` state then it is completed. This isn't ideal but works for the moment.

Lastly, in  the case where the blocking request times out the client will fall back to polling at the default interval.
A
Aron Carroll committed
c1a12b0f60122442c4115c23cc964fa96f2042fc
Parent: be0f323
Committed by GitHub <noreply@github.com> on 10/1/2024, 10:44:15 PM