replicate-python icon indicating copy to clipboard operation
replicate-python copied to clipboard

Training is missing metrics property in response object

Open digitalchild opened this issue 8 months ago • 1 comments

The Training resource object is missing the metrics property, so it is not set when getting a response from the API. If you do a raw curl or get request to the endpoint, the metrics are included.

Prediction has metrics and is working as it should.

digitalchild avatar May 06 '25 12:05 digitalchild

Hi @digitalchild 👋

Thanks for spotting this!

You're absolutely right — the Training object was missing the metrics property in the replicate-python client, even though it's returned by the raw API.

This issue has now been addressed in the PR #429, which adds the missing metrics field to the Training model.

To fix this on your end:

  1. Update to the latest version of replicate-python once the PR is merged and released:
    pip install --upgrade replicate

  2. After the update, you'll be able to access training metrics directly like this:
    training.metrics["accuracy"] (or whichever metric your training returns)

Let me know if you need help accessing the metrics after the update!
Thanks again for your contribution 🙌

Ivan-developer0 avatar May 15 '25 15:05 Ivan-developer0