replicate-python icon indicating copy to clipboard operation
replicate-python copied to clipboard

`replicate.run()` does not respect `wait=False`

Open zeke opened this issue 11 months ago • 1 comments

Client version: 1.0.4

This snippet blocks until the prediction is done:

import replicate

print("starting")
output = replicate.run(
    "tencent/hunyuan-video:6c9132aee14409cd6568d030453f1ba50f5f3412b844fe67f78a9eb62d55664f",
    input={"prompt": "A cat walks on the grass, realistic style"},
    wait=False
)
print(output.__dict__)
print("done")

I'm not really sure what the expected behavior should be here...

The current docs in the README say this:

The timeout can be configured by passing wait=x to replicate.run() where x is a timeout in seconds between 1 and 60. To disable the sync mode you can pass wait=False.

If you're disabling sync mode with replicate.run, where does that leave you? Async mode? What should it return?

cc @hbqdev

zeke avatar Feb 14 '25 00:02 zeke