Skip to content

Training is missing metrics property in response object #428

Description

@digitalchild

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.

Activity

  1. Ivan-developer0 commented on May 15, 2025

    @Ivan-developer0

    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 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions