Skip to content

Commit 1ae54d5

Browse files
committed
Fix warnings
Signed-off-by: Mattt Zmuda <[email protected]>
1 parent 46d69d1 commit 1ae54d5

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

replicate/helpers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class FileOutput(httpx.SyncByteStream, httpx.AsyncByteStream):
117117
url: str
118118
client: "Client"
119119

120-
def __init__(self, url: str, client: "Client"):
120+
def __init__(self, url: str, client: "Client") -> None:
121121
self.url = url
122122
self.client = client
123123

@@ -129,8 +129,7 @@ def read(self) -> bytes:
129129
def __iter__(self) -> Iterator[bytes]:
130130
with self.client._client.stream("GET", self.url) as response:
131131
response.raise_for_status()
132-
for chunk in response.iter_bytes():
133-
yield chunk
132+
yield from response.iter_bytes()
134133

135134
async def aread(self) -> bytes:
136135
async with self.client._async_client.stream("GET", self.url) as response:

replicate/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from typing_extensions import NotRequired, TypedDict, Unpack, deprecated
44

55
from replicate.exceptions import ReplicateException
6-
from replicate.identifier import ModelVersionIdentifier
76
from replicate.helpers import async_encode_json, encode_json
7+
from replicate.identifier import ModelVersionIdentifier
88
from replicate.pagination import Page
99
from replicate.prediction import (
1010
Prediction,

replicate/training.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
from typing_extensions import NotRequired, Unpack
1515

16-
from replicate.identifier import ModelVersionIdentifier
1716
from replicate.helpers import async_encode_json, encode_json
17+
from replicate.identifier import ModelVersionIdentifier
1818
from replicate.model import Model
1919
from replicate.pagination import Page
2020
from replicate.resource import Namespace, Resource

0 commit comments

Comments
 (0)