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

Missing Type From the Inference Package #584

Open
abdel-17 opened this issue Mar 26, 2024 · 1 comment · Fixed by #585 or #651
Open

Missing Type From the Inference Package #584

abdel-17 opened this issue Mar 26, 2024 · 1 comment · Fixed by #585 or #651
Assignees
Labels
inference @huggingface/inference related tooling

Comments

@abdel-17
Copy link
Contributor

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.

@coyotte508
Copy link
Member

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 pushed a commit that referenced this issue Mar 27, 2024
@coyotte508 coyotte508 reopened this Mar 27, 2024
@coyotte508 coyotte508 added inference @huggingface/inference related tooling labels Mar 27, 2024
@coyotte508 coyotte508 self-assigned this May 3, 2024
coyotte508 added a commit that referenced this issue May 3, 2024
Only for TS types.

Later let's do it without, cc #584 (comment)
coyotte508 added a commit that referenced this issue May 3, 2024
@coyotte508 coyotte508 reopened this May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inference @huggingface/inference related tooling
Projects
None yet
2 participants