Skip to content

Commit 0ca2346

Browse files
authored
Update deprecation warnings for Model.predict and Version.predict (#137)
* Add deprecation warning to docstring for Version.predict Signed-off-by: Mattt Zmuda <[email protected]> * Update deprecation message to use replicate.run instead of version.predict Signed-off-by: Mattt Zmuda <[email protected]> --------- Signed-off-by: Mattt Zmuda <[email protected]>
1 parent d662f2f commit 0ca2346

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

replicate/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ class Model(BaseModel):
2323

2424
def predict(self, *args, **kwargs) -> None:
2525
"""
26-
DEPRECATED: Use `version.predict()` instead.
26+
DEPRECATED: Use `replicate.run()` instead.
2727
"""
2828

2929
raise ReplicateException(
30-
"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"
30+
"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"
3131
)
3232

3333
@property

replicate/version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class Version(BaseModel):
3232

3333
def predict(self, **kwargs) -> Union[Any, Iterator[Any]]:
3434
"""
35+
DEPRECATED: Use `replicate.run()` instead.
36+
3537
Create a prediction using this model version.
3638
3739
Args:

0 commit comments

Comments
 (0)