Skip to content

replicate.deployments.get fails #270

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

Closed
alxiang opened this issue Mar 21, 2024 · 1 comment
Closed

replicate.deployments.get fails #270

alxiang opened this issue Mar 21, 2024 · 1 comment

Comments

@alxiang
Copy link

alxiang commented Mar 21, 2024

We created a deployment of demucs (https://replicate.com/cjwbw/demucs) on Replicate a few weeks ago. We were on version 0.22.0 of the package, and the following code worked fine:

replicate.deployments.get("pathstone-labs/lifelike-demucs")

However, when we upload to version 0.25.0 of the package, we see the following error:

1 validation error for Deployment current_release -> configuration -> scaling field required (type=value_error.missing)

So we are currently sticking to v0.22.0. Was there some kind of backwards incompatibility introduced in the recent versions of this package? Thanks.

mattt added a commit that referenced this issue Mar 21, 2024
#258 added fields to the `Deployment` model provided by the new
`deployments.{get,list,update}` endpoints. However, those were
implemented against a version of the OpenAPI specification that
disagreed with the actual API responses. Specifically, the
`min_instances` and `max_instances` properties were listed as
subproperties of a `scaling` object rather than direct fields. The
result — as reported in #270 — was Pydantic validation errors like this:

```
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for Deployment
current_release -> configuration -> scaling
field required (type=value_error.missing)"
```

This PR updates the `Deployment` model to correctly locate
`min_instances` and `max_instances` as properties of
`current_release.configuration`.

Signed-off-by: Mattt Zmuda <[email protected]>
@mattt
Copy link
Contributor

mattt commented Mar 21, 2024

Hi @alxiang. You're correct, this was a regression. I apologize for any inconvenience this caused. I just merged a fix for this in #271, which is now available in 0.25.1. Please let me know if you still see this or run into any other issues.

@mattt mattt closed this as completed Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants