Skip to content

Error 422 - Additional property signal not allowed. #249

Closed
@VektorTech

Description

@VektorTech

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
}

Activity

added a commit that references this issue on May 2, 2024
87b5e07
mattt

mattt commented on May 2, 2024

@mattt
Contributor

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

VektorTech commented on May 2, 2024

@VektorTech
Author

Hey @mattt, I'm still getting the error with the updated version, and the signal: {} field is still being dispatched with the payload.

mattt

mattt commented on May 2, 2024

@mattt
Contributor

@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?

reopened this on May 2, 2024
ZeroCho

ZeroCho commented on May 3, 2024

@ZeroCho

for me, upgrading to 0.29.3 fixed this issue.

VektorTech

VektorTech commented on May 3, 2024

@VektorTech
Author

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

mattt

mattt commented on May 3, 2024

@mattt
Contributor

@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

mattt commented on May 3, 2024

@mattt
Contributor

@VektorTech That fix is now available in v0.29.4. Please give that a try and confirm that everything's working as expected.

VektorTech

VektorTech commented on May 3, 2024

@VektorTech
Author

@mattt, v0.29.4 solves the issue, thank you.

GowthamMahadikar

GowthamMahadikar commented on Aug 11, 2024

@GowthamMahadikar

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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @mattt@jason-engage@ZeroCho@VektorTech@S1001C

      Issue actions

        Error 422 - Additional property signal not allowed. · Issue #249 · replicate/replicate-javascript