Skip to content

[InferenceSnippet] Improve JS snippets (import fs, don't instanciate client) #1294

Open
@Wauplin

Description

@Wauplin

Two orthogonal but related comments:

Originally from @SBrandeis in #1291 (comment) (+see #1291 (comment))

More general remark: the types for stand-alone methods (automaticSpeechRecognition) have a correct typing, while methods on the InferenceClient class (client.automaticSpeechRecognition) do not
Until this is fixed, I would advocate to use the stand-alone functions for better user experience

Originally from @SBrandeis in #1291 (comment)

Maybe let's add an import statement for this
Side note: I think the fs API is only available in a NodeJS context 😅
The equivalent in the Browser is the File Reader API
I think it's fine if the snippets are only compatible with Node, for simplicity - thoughts @julien-c @coyotte508 ?

Let's be sure we align with Python client as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    inference@huggingface/inference related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions