From 6a5deefbd030658ac5add04a8fcfcdadc1c241a7 Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Mon, 7 Aug 2023 04:21:38 -0700 Subject: [PATCH 1/2] Add deprecation warning to docstring for Version.predict Signed-off-by: Mattt Zmuda --- replicate/version.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/replicate/version.py b/replicate/version.py index 71cee3ad..2f68f20f 100644 --- a/replicate/version.py +++ b/replicate/version.py @@ -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: From 7d2c6c006e3e894b85dba05dcb2f659baf8ee6f5 Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Mon, 7 Aug 2023 04:22:21 -0700 Subject: [PATCH 2/2] Update deprecation message to use replicate.run instead of version.predict Signed-off-by: Mattt Zmuda --- replicate/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/replicate/model.py b/replicate/model.py index 4787e337..081386c4 100644 --- a/replicate/model.py +++ b/replicate/model.py @@ -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