Skip to content
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

Spec for audio to audio #502

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Spec for audio to audio #502

wants to merge 5 commits into from

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Feb 23, 2024

Json schema for audio-to-audio task. This is the "expected type" in the Python client but would prefer to double-check it's correct before continuing. Ping @Vaibhavs10 @osanseviero could you have a look please?

(useful for huggingface/huggingface_hub#2036)

@coyotte508
Copy link
Member

Should generate TS type with the helper command (pnpm run build for ex)

@Wauplin
Copy link
Contributor Author

Wauplin commented Feb 23, 2024

Should generate TS type with the helper command

Done in f80bf58.

Copy link
Contributor

@SBrandeis SBrandeis left a comment

Choose a reason for hiding this comment

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

nice

packages/tasks/src/tasks/audio-to-audio/spec/input.json Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the pipeline generating several audios at once?
If not I would recommend not wrapping the output in an array for consistency with other tasks (see ImageToText for example)
https://github.com/huggingface/huggingface.js/blob/af447753043472d8ba65ab0591be7487433f7261/packages/tasks/src/tasks/image-to-text/spec/output.json#L1-L15

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it does. You can try on the widget in https://huggingface.co/tasks/audio-to-audio.

image

"type": "string",
"description": "The label of the audio file."
},
"content-type": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe?
Can you link to where those parameters are documented please?

Suggested change
"content-type": {
"content_type": {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not documented AFAIK. I only know it from the call made by the widget on https://huggingface.co/tasks/audio-to-audio 😕

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For content-type vs content_type I've added a normalizer rule in Python to accept both since the Python attribute can only be content_type (and is generated like this).

Copy link
Member

Choose a reason for hiding this comment

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

@Wauplin Wauplin requested a review from julien-c as a code owner March 12, 2024 11:14
*
* A generated audio file with its label.
*/
export interface AudioToAudioOutputElement {
Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants