Closed
Description
Sending a request to https://api.replicate.com/v1/models/meta/meta-llama-3-70b-instruct/predictions
from the browser with abort signal,
await this.replicate.run(model, {
input,
signal: this.abortSignal,
}
results in the following error:
https://api.replicate.com/v1/models/meta/meta-llama-3-70b-instruct/predictions failed with status 422 : {"detail":"- Additional property signal is not allowed\n","status":422,"title":"Input validation failed","invalid_fields":[{"type":"additional_property_not_allowed","field":"","description":"Additional property signal is not allowed"}]}
Request payload show in chrome devtools:
{
"signal": {},
"input": {
"prompt": "hey",
"prompt_template": "",
"max_tokens": "",
"temperature": 1,
"presence_penalty": 0,
"frequency_penalty": 0
},
"stream": true
}
Metadata
Metadata
Assignees
Labels
No labels
Activity
Extract `signal` property from the `run()` options
mattt commentedon May 2, 2024
Hi @VektorTech. Sorry, that was a bug in the client. We have a fix in #251 that landed in the latest version, v0.29.2. Please
npm i replicate@latest
to update to the latest and let us know if you're still seeing this error. Thanks!VektorTech commentedon May 2, 2024
Hey @mattt, I'm still getting the error with the updated version, and the
signal: {}
field is still being dispatched with the payload.mattt commentedon May 2, 2024
@VektorTech Hmm, this assertion should test that
signal
isn't sent in the request body... Can you share a minimal example that reproduces the issue with a public model?ZeroCho commentedon May 3, 2024
for me, upgrading to 0.29.3 fixed this issue.
VektorTech commentedon May 3, 2024
Hey @mattt, I've attached a link to a small Vite project that reproduces the issue. As you'll see, Replicate is initialized and runs from inside a service worker, as with my current setup. In this environment, the library passes the
signal
field to the/predictions
endpoint where the error occurs.replicate_bug-Archive.zip
replicate.stream
#254mattt commentedon May 3, 2024
@VektorTech Thanks so much for sharing that. I didn't realize you were calling
replicate.stream
. And looking at the implementation of that method, I immediately see the problem. This should be fixed by #254.mattt commentedon May 3, 2024
@VektorTech That fix is now available in v0.29.4. Please give that a try and confirm that everything's working as expected.
VektorTech commentedon May 3, 2024
@mattt, v0.29.4 solves the issue, thank you.
GowthamMahadikar commentedon Aug 11, 2024
Error generating image: ReplicateError Details: title: Invalid version or not permitted status: 422 detail: The specified version does not exist (or perhaps you don't have permission to use it?) i am getting this error from past 6 days
@mattt
3 remaining items