Skip to content
Open
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
7 changes: 2 additions & 5 deletions replicate/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ def output_iterator(self) -> Iterator[Any]:
previous_output = self.output or []
while self.status not in ["succeeded", "failed", "canceled"]:
output = self.output or []
new_output = output[len(previous_output) :]
yield from new_output
yield from output[len(previous_output) :]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Prediction.output_iterator refactored with the following changes:

previous_output = output
time.sleep(self._client.poll_interval)
self.reload()
Expand All @@ -79,9 +78,7 @@ def output_iterator(self) -> Iterator[Any]:
raise ModelError(self.error)

output = self.output or []
new_output = output[len(previous_output) :]
for output in new_output:
yield output
yield from output[len(previous_output) :]

def cancel(self) -> None:
"""
Expand Down
3 changes: 1 addition & 2 deletions replicate/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def predict(self, **kwargs) -> Union[Any, Iterator[Any]]:

def get_transformed_schema(self) -> dict:
schema = self.openapi_schema
schema = make_schema_backwards_compatible(schema, self.cog_version)
return schema
return make_schema_backwards_compatible(schema, self.cog_version)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Version.get_transformed_schema refactored with the following changes:



class VersionCollection(Collection):
Expand Down
3 changes: 1 addition & 2 deletions tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@


def create_client():
client = Client(api_token="abc123")
return client
return Client(api_token="abc123")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function create_client refactored with the following changes:



def get_mock_schema():
Expand Down