huggingface.js icon indicating copy to clipboard operation
huggingface.js copied to clipboard

Missing Type From the Inference Package

Open abdel-17 opened this issue 2 years ago • 1 comments

In the types of the @huggingface/inference package, the textGeneration function is declared as follows

export function textGeneration(
    args: BaseArgs & TextGenerationInput,
    options?: Options
): Promise<TextGenerationOutput>;

But the TextGenerationOutput type is missing from the file, so the return type is inferred as any by TypeScript.

In the source code, the TextGenerationOutput type is imported from this file in a separate package, which does correctly have the type, so this is likely an issue with the build step.

abdel-17 avatar Mar 26 '24 20:03 abdel-17

Ah yes indeed cc @SBrandeis

Current typing is generated in generate-dts.ts for the inference package, would need to modify the script. Maybe call tsup with --dts-resolve as a first step and then our custom stuff.

coyotte508 avatar Mar 27 '24 08:03 coyotte508