replicate / replicate-go

Go client for Replicate
https://replicate.com
Apache License 2.0
65 stars 9 forks source link

Run swallows information about failures #72

Closed jlewi closed 3 weeks ago

jlewi commented 2 months ago

The helper function Client.Run only returns Prediction.Output https://github.com/replicate/replicate-go/blob/832859755ef4c465daf209271a889d120e4416d6/run.go#L25

I ran a prediction that failed and Client.Run returned non -nil error even though the Prediction had failed

I'm not sure under what conditions I could use Client.Run as opposed to calling CreatePrediction and Wait myself. Since it looks like Client.Run doesn't let me check whether the prediction succeeded or not I don't think I can rely on it and need to use CreatePrediction and Wait so I can check that the request actually worked.

mattt commented 3 weeks ago

Thanks for calling this out, @jlewi. I just merged #76, which has Run now return a ModelError struct containing the failing prediction so you can get the underlying ID, error, and logs.