Skip to content

Bug: parsing error when creating prediction with stream=True  #175

Closed
@joehoover

Description

@joehoover

I tried to set stream=True when creating a prediction like:

prediction = replicate.predictions.create(
    version=version, 
    input={'tps':10},
    stream=True
)

and received the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/joe/.pyenv/versions/3.10.9/envs/lm-infra-sims/lib/python3.10/site-packages/replicate/prediction.py", line 210, in create
    resp = self._client._request(
  File "/Users/joe/.pyenv/versions/3.10.9/envs/lm-infra-sims/lib/python3.10/site-packages/replicate/client.py", line 81, in _request
    raise ReplicateError(resp.json()["detail"])
replicate.exceptions.ReplicateError: Failed to parse request body as JSON: json: cannot unmarshal string into Go struct field Prediction.stream of type bool
>>> 

Assuming there's not user error and/or this isn't already fixed, happy to open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions