Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix streaming parameter encoding in prediction creation requests #178

Merged
merged 3 commits into from
Oct 29, 2023
Merged
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
2 changes: 1 addition & 1 deletion replicate/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def create( # type: ignore
if webhook_events_filter is not None:
body["webhook_events_filter"] = webhook_events_filter
if stream is True:
body["stream"] = "true"
body["stream"] = True

resp = self._client._request(
"POST",
Expand Down
4 changes: 2 additions & 2 deletions replicate/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def create( # type: ignore
"""

input = encode_json(input, upload_file=upload_file)
body = {
body: Dict[str, Any] = {
"version": version if isinstance(version, str) else version.id,
"input": input,
}
Expand All @@ -205,7 +205,7 @@ def create( # type: ignore
if webhook_events_filter is not None:
body["webhook_events_filter"] = webhook_events_filter
if stream is True:
body["stream"] = "true"
body["stream"] = True

resp = self._client._request(
"POST",
Expand Down
Loading