Skip to content

Commit ff26a73

Browse files
committed
Fix passing of client class to _use()
This fixes an issue where the instance rather than the class was passed into use resulting in an exception when performing the `isinstance` check in `use()`.
1 parent 0183932 commit ff26a73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/replicate/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def use(
319319
from .lib._predictions_use import use as _use
320320

321321
# TODO: Fix mypy overload matching for streaming parameter
322-
return _use(self, ref, hint=hint, streaming=streaming) # type: ignore[call-overload, no-any-return]
322+
return _use(self.__class__, ref, hint=hint, streaming=streaming) # type: ignore[call-overload, no-any-return]
323323

324324
@deprecated("replicate.stream() is deprecated. Use replicate.use() with streaming=True instead")
325325
def stream(
@@ -726,7 +726,7 @@ def use(
726726
from .lib._predictions_use import use as _use
727727

728728
# TODO: Fix mypy overload matching for streaming parameter
729-
return _use(self, ref, hint=hint, streaming=streaming) # type: ignore[call-overload, no-any-return]
729+
return _use(self.__class__, ref, hint=hint, streaming=streaming) # type: ignore[call-overload, no-any-return]
730730

731731
@deprecated("replicate.stream() is deprecated. Use replicate.use() with streaming=True instead")
732732
async def stream(

0 commit comments

Comments
 (0)