-
Notifications
You must be signed in to change notification settings - Fork 388
[Inference Providers] isolate image-to-image
payload build for HF Inference API
#1439
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(high level feedback)
I don't understand - why can't it be made async? |
Hey folks. Looking forward to getting this shipped to unblock #1427 -- anything I can do to help? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to merge to unlock downstream tasks
I'm not a fan of having 2 different functions for the same purpose, and I advocate to make preparePayload
async
instead
I also understand it's a bug and breaking API change, so let's merge as is.
Mainly because we want |
This PR is a prerequisite for #1427.
It refactors the payload construction for
hf-inference
by isolating it into a separate async function. Note that adding a new async function to build the payload is necessary becauseHFInferenceImageToImageTask.preparePayload
cannot be made async, yet the payload construction requires asynchronous operations. A similar pattern has already been implemented for automaticSpeechRecognition with fal.