Skip to content

Commit 4cc05ad

Browse files
authored
Include stream=True in prediction stream snippet (#279)
Add missing `stream=True` in this snippet. Without it, you'll get error message about the model not supporting streaming.
1 parent 1066584 commit 4cc05ad

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ This is helpful when you want the ID of the prediction separate from its output.
119119
120120
```python
121121
version = "02e509c789964a7ea8736978a43525956ef40397be9033abf9fd2badfe68c9e3"
122-
prediction = replicate.predictions.create(version=version, input={
123-
"prompt": "Please write a haiku about llamas.",
124-
})
122+
prediction = replicate.predictions.create(
123+
version=version,
124+
input={"prompt": "Please write a haiku about llamas."},
125+
stream=True,
126+
)
125127
126128
for event in prediction.stream():
127129
print(str(event), end="")

0 commit comments

Comments
 (0)