Skip to content
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

Update deprecation warnings for Model.predict and Version.predict #137

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions replicate/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class Model(BaseModel):

def predict(self, *args, **kwargs) -> None:
"""
DEPRECATED: Use `version.predict()` instead.
DEPRECATED: Use `replicate.run()` instead.
"""

raise ReplicateException(
"The `model.predict()` method has been removed, because it's unstable: if a new version of the model you're using is pushed and its API has changed, your code may break. Use `version.predict()` instead. See https://github.com/replicate/replicate-python#readme"
"The `model.predict()` method has been removed, because it's unstable: if a new version of the model you're using is pushed and its API has changed, your code may break. Use `replicate.run()` instead. See https://github.com/replicate/replicate-python#readme"
)

@property
Expand Down
2 changes: 2 additions & 0 deletions replicate/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Version(BaseModel):

def predict(self, **kwargs) -> Union[Any, Iterator[Any]]:
"""
DEPRECATED: Use `replicate.run()` instead.

Create a prediction using this model version.

Args:
Expand Down