@@ -54,21 +54,7 @@ replicate.run(
54
54
)
55
55
```
56
56
57
- Some models, like [ andreasjansson/blip-2] ( https://replicate.com/andreasjansson/blip-2 ) , have files as inputs.
58
- To run a model that takes a file input,
59
- pass a URL to a publicly accessible file.
60
- Or, for smaller files (<10MB), you can pass a file handle directly.
61
-
62
- ``` python
63
- >> > output = replicate.run(
64
- " andreasjansson/blip-2:f677695e5e89f8b236e52ecd1d3f01beb44c34606419bcc19345e046d8f786f9" ,
65
- input = { " image" : open (" path/to/mystery.jpg" ) }
66
- )
67
-
68
- " an astronaut riding a horse"
69
- ```
70
-
71
- > [ !NOTE]
57
+ > [ !TIP]
72
58
> You can also use the Replicate client asynchronously by prepending ` async_ ` to the method name.
73
59
>
74
60
> Here's an example of how to run several predictions concurrently and wait for them all to complete:
@@ -94,6 +80,19 @@ Or, for smaller files (<10MB), you can pass a file handle directly.
94
80
> print (results)
95
81
> ```
96
82
83
+ To run a model that takes a file input you can pass either
84
+ a URL to a publicly accessible file on the Internet
85
+ or a handle to a file on your local device.
86
+
87
+ ```python
88
+ >> > output = replicate.run(
89
+ " andreasjansson/blip-2:f677695e5e89f8b236e52ecd1d3f01beb44c34606419bcc19345e046d8f786f9" ,
90
+ input = { " image" : open (" path/to/mystery.jpg" ) }
91
+ )
92
+
93
+ " an astronaut riding a horse"
94
+ ```
95
+
97
96
## Run a model and stream its output
98
97
99
98
Replicate’s API supports server-sent event streams (SSEs) for language models.
0 commit comments