Open
Description
System Info
@huggingface/transformers: 3.5.0
typescript: 5.6.3
Angular: 19.1.3
Environment/Platform
- Website/web-app
- Browser extension
- Server-side (e.g., Node.js, Deno, Bun)
- Desktop app (e.g., Electron)
- Other (e.g., VSCode extension)
Description
When trying to add types to my use of pipeline()
, I use the following snippet
import {pipeline, AutomaticSpeechRecognitionPipeline} from '@huggingface/transformers';
...
const instance: Promise<AutomaticSpeechRecognitionPipeline> = pipeline(
'automatic-speech-recognition',
'Xenova/whisper-base',
{progress_callback},
);
My editor now complains about the pipeline
invocation with TS2590: Expression produces a union type that is too complex to represent.
Reproduction
See https://stackblitz.com/edit/vitejs-vite-bvwhnlwn?file=src%2Fmain.ts&view=editor
In a project with Typescript and @huggingface/transformers, attempt to set the type returned by pipeline