-
Notifications
You must be signed in to change notification settings - Fork 561
Add support to image-to-video task for inference
#1471
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
image-to-video task image-to-video task for inference
Wauplin
left a comment
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.
Thanks @apolinario ! Pretty solid PR already :) I've made some high-level comments while you are still working on it. I do think it's best to split the PR into 2 (one for spec definition, one for proper implementation for each provider).
| }; | ||
|
|
||
| const prepareImageToVideoInput = (model: ModelDataMinimal): object => { | ||
| const data = JSON.parse(getModelInputSnippet(model) as string); |
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.
Could you add a simple example in https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/snippets/inputs.ts ? Something like this:
const inputsImageToVideo = () => `{
"image": "cat.png",
"prompt": "Make the cat dance."
}`;and then
"image-to-video": inputsImageToVideo,in the modelInputSnippets mapping.
This way, const data = JSON.parse(getModelInputSnippet(model) as string); will return a valid payload to generate the inference snippets.
| @@ -0,0 +1,23 @@ | |||
| import type { ImageToVideoInput } from "@huggingface/tasks"; | |||
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.
Let's not add this file yet and wait for a follow-up PR. The current implementation assumes it works with FalAI and Replicate which is not the case yet -and not tested-. Better to separate them and keep this PR for specs definition only.
…pet to tasks snippets)
|
Thanks @Wauplin ! I've kept it strictly spec-based for now and applied your suggestion for snippets/inputs.ts |
Wauplin
left a comment
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.
Looks good to me, thanks!
Let's wait for another review, especially for the about.md/data.ts part which I know less about
merveenoyan
left a comment
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.
thanks a lot 💗
Co-authored-by: Merve Noyan <merveenoyan@gmail.com>
Co-authored-by: Merve Noyan <merveenoyan@gmail.com>
Co-authored-by: Merve Noyan <merveenoyan@gmail.com>
Co-authored-by: Merve Noyan <merveenoyan@gmail.com>
Co-authored-by: Merve Noyan <merveenoyan@gmail.com>
Co-authored-by: Merve Noyan <merveenoyan@gmail.com>
Co-authored-by: Merve Noyan <merveenoyan@gmail.com>
…gface/huggingface.js into origin/add-image-to-video
|
Thanks merve, applied your suggestions! |
SBrandeis
left a comment
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.
Approving in principle - deferring to @merveenoyan re: data.ts
I will review the inference client implementation more thoroughly :)
merveenoyan
left a comment
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.
LGTM :)
Internal discussion
The goal is:
about.mddata.tsfor the/taskson huggingface.co is pending merging this PR