Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Inference] Add async polling support for Replicate provider#1816

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lucataco wants to merge2 commits intohuggingface:main
base:main
Choose a base branch
Loading
fromlucataco:codex/implement-async-polling-for-replicate

Conversation

@lucataco
Copy link
Contributor

This PR adds async polling for Replicate
To help the huggingface team so that they no longer need an allow-list of Replicate models to show Hub users

Screenshot 2025-10-20 at 2 33 56 PM

@SBrandeis

Wauplin reacted with hooray emojiSBrandeis reacted with heart emoji
Copy link
Contributor

@hanouticelinahanouticelina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

thanks@lucataco for the PR! I left some comments

constprediction=(awaitpollResponse.json())asReplicateAsyncResponse;
constpredictionStatus=prediction.status;

if(!predictionStatus||predictionStatus==="succeeded"){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

is it intentional to treat "no status" as a successful response?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think we have to removePrefer: wait from the headers (defined inprepareHeaders) now that all the tasks are using async polling

output?:string|string[];
}

typeReplicatePredictionStatus="starting"|"processing"|"succeeded"|"failed"|"canceled"|"queued";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

i believe this gives tighter typings and better autocomplete support

Suggested change
typeReplicatePredictionStatus="starting"|"processing"|"succeeded"|"failed"|"canceled"|"queued";
constREPLICATE_STATUSES=[
"starting",
"processing",
"succeeded",
"failed",
"canceled",
"queued",
]asconst;
typeReplicatePredictionStatus=(typeofREPLICATE_STATUSES)[number];

SBrandeis reacted with thumbs up emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@hanouticelinahanouticelinahanouticelina left review comments

@julien-cjulien-cAwaiting requested review from julien-cjulien-c is a code owner

@SBrandeisSBrandeisAwaiting requested review from SBrandeisSBrandeis is a code owner

@WauplinWauplinAwaiting requested review from Wauplin

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@lucataco@hanouticelina

[8]ページ先頭

©2009-2025 Movatter.jp