replicate/replicate-python

'function' object has no attribute 'run'

homanp opened this issue · 4 comments

Summary

Getting an exception when running the example in README:

import replicate

export REPLICATE_API_TOKEN=<your token>

replicate.run(
    "stability-ai/stable-diffusion:27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478",
    input=prompt
)

Expected behaviour

The model should return an Array containing a URL.

mattt commented

From the Discord thread, it sounds like you were able to resolve this issue. Please let us know if you run into any other problems with this library. Thanks!

Good morning, could you share the Discord link with the solution to the problem? I'm facing it now :D

homanp commented

Good morning, could you share the Discord link with the solution to the problem? I'm facing it now :D

It's in a closed channel. What Python version are you running?

Ook! I'm using Python 3.11.2. I temporarily solved it by importing the replicate library and the function of running the model in a separate .py file. It was some conflict it had with other imports, I believe.