Skip to content

Conversation

@SBrandeis
Copy link
Contributor

@SBrandeis SBrandeis commented Jan 20, 2025

TL;DR

  • Use Typescript interfaces generated from @huggingface/tasks JSON schemas to type the input types of the Inference client
  • try to maintain as much backwards-compatibility as possible with the existing inference client API

"audio": {
"description": "The generated audio waveform."
"description": "The generated audio waveform.",
"comment": "type=binary"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @Wauplin @hanouticelina

I used this trick to mark a parameter as "binary" (which translates, in the generated Typescript code, to declaring it to be of type Blob)

Generation code: https://github.com/huggingface/huggingface.js/pull/1116/files#diff-3a9454ed7c359e2e0522703d9acf4559f6b10fdd67236692bdd4422dd9c8f472R97-R182

@SBrandeis SBrandeis marked this pull request as ready for review January 21, 2025 14:53
@SBrandeis SBrandeis changed the title [WIP] Inference: generate binary types as Blob and use the generated types in the inference client [Inference] Generate binary types as Blob and use the generated types in the inference client Jan 21, 2025
Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

haven't dived in detail but the compatibility plan LGTM @SBrandeis

@SBrandeis SBrandeis merged commit 2c759b5 into main Jan 23, 2025
5 checks passed
@SBrandeis SBrandeis deleted the inference/generate-binary-type-js branch January 23, 2025 16:44
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.

3 participants