-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when generate image from Replicate (url vs base64) in output #382
Comments
I am getting the same error too. Replicate team, please help resolve this issue. |
cc @mattt Can you please have a look at this? Our infer APIs have stopped working. |
they abandoned it, things stop working, the api response changes suddenly, there is no support, a huge mess |
cc @nickstenning Please check this |
@paulocoutinhox @eloelo-techadmin we've made some changes in 1.0.0 that smooths out the flow for working with file outputs. By default the See the release notes for more details: https://github.com/replicate/replicate-python/releases/tag/1.0.0 This means your example code no longer needs to use output = replicate.run(model_path, input=replicate_input)
# download and save the generated image
for output_item in output:
# TODO: replicate needs to provide a way to get the filename/filetype of the model
extension = ".png"
unique_file_name = f"{uuid.uuid4()}{extension}"
file_content = ContentFile(output.read()) You can disable this behavior and revert to the model output by passing output = replicate.run(model_path, input=replicate_input, use_file_output=False) Regarding the API interface, it now has two modes, sync, and async. The former will hold the connection open and deliver the prediction in the same request, for smaller files we inline the file as base64 data in order to reduce latency even further. https://replicate.com/docs/topics/predictions/create-a-prediction The client libraries now use this new interface by default controlled by the output = replicate.run(model_path, input=replicate_input, wait=False, use_file_output=False) We are working on updating the documentation to make this clearer. |
I just wanted to raise that with the same version of the client my production environment broke today - I did not update anything. This means that something else changed upstream, and I am sorry to tell you that this is very bad practice. I suggest you to revert the changes on your backends, to prevent a lot of deployed apps to stop working and potentially loose a lot of customers. |
If this is true it's absolutely not intended. Please share details of which client version you are using. |
I am using version |
Since |
What @erbridge said is correct, but what this does mean is that our API didn't change behaviour for most clients. Unfortunately, I'm really sorry we broke stuff for you. We'll be figuring out how to do this better in future. |
I see what you are saying folks, and apologies for assuming you did something wrong. Sorry ! <3 |
And to be clear: your assumptions were and are totally reasonable. We didn't think through what it would mean to ship a breaking in change in 1.x that was only activated later. This one is entirely on us. |
We've rolled back the behaviour of data URLs which caused this, and have written up the incident on our blog: https://replicate.com/blog/data-urls-in-our-sync-api We messed up this rollout, and we know this has to be better for a company that's all about APIs, and we're sorry for falling short here. |
All good, and kudos for owning up to this! Let's face it - we're human beings, not LLMs (yet). Making mistakes and learning from them is just part of the package deal of being human. No way I'd jump ship to another provider - the Replicate crew is top-notch! P.S. So... about those free credits... 👀 (kidding! 😂) |
Hi,
I started get an error in production now:
Lib:
replicate==1.0.2
My code:
Can you help me?
Output data maybe is returning in base64 instead of the URL.
Thanks.
The text was updated successfully, but these errors were encountered: