-
Notifications
You must be signed in to change notification settings - Fork 1k
Labels
Description
System Info
transformers.js - 3.7.2
github codespaces
node - 22.17.0
Next.js 15 for frontend
Node.js for backend
typescript - 5.8.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
I was trying to use the gemma-3-1b-it-ONNX-GQA for giving prompt to generate text.
Reproduction
package.json
{
"devDependencies": {
"@huggingface/transformers": "^3.7.2"
}
}
tsconfig.json
{
"compilerOptions": {
"target": "ES6",
"baseUrl": "./src",
"rootDir": "./src",
"module": "commonjs",
"paths": {
"@/*": ["*"]
},
"typeRoots": ["./src/types", "./node_modules/@types"],
"strict": true,
"outDir": "./dist",
"esModuleInterop": true
},
"include": ["./src/**/*"]
}
main.ts
import { pipeline } from "@huggingface/transformers";
executing tsc returns -
32 static from_pretrained(pretrained_model_name_or_path: string, options?: PretrainedProcessorOptions): Promise<Processor>;
~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/@huggingface+transformers@3.7.2/node_modules/@huggingface/transformers/types/models/mgp_str/processing_mgp_str.d.ts:52:5 - error TS2416: Property 'batch_decode' in type 'MgpstrProcessor' is not assignable to the same property in base type 'Processor'.
Type '([char_logits, bpe_logits, wp_logits]: Tensor[]) => { generated_text: string[]; scores: number[]; char_preds: string[]; bpe_preds: string[]; wp_preds: string[]; }' is not assignable to type '(batch: number[][] | Tensor, decode_args?: any) => string[]'.
Types of parameters '__0' and 'batch' are incompatible.
Type 'number[][] | Tensor' is not assignable to type 'Tensor[]'.
Type 'number[][]' is not assignable to type 'Tensor[]'.
Type 'number[]' is missing the following properties from type 'Tensor': dims, type, data, size, and 47 more.
52 batch_decode([char_logits, bpe_logits, wp_logits]: import("../../utils/tensor.js").Tensor[]): {
~~~~~~~~~~~~
../node_modules/.pnpm/@huggingface+transformers@3.7.2/node_modules/@huggingface/transformers/types/utils/maths.d.ts:116:125 - error TS2304: Cannot find name 'Float16Array'.
116 export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float16Array | Float32Array | Float64Array;
~~~~~~~~~~~~
../node_modules/.pnpm/@huggingface+transformers@3.7.2/node_modules/@huggingface/transformers/types/utils/tensor.d.ts:160:39 - error TS2552: Cannot find name 'Float16ArrayConstructor'. Did you mean 'Float64ArrayConstructor'?
160 float16: Uint16ArrayConstructor | Float16ArrayConstructor;
~~~~~~~~~~~~~~~~~~~~~~~
Found 4 errors in 4 files.
Errors Files
1 ../node_modules/.pnpm/@huggingface+transformers@3.7.2/node_modules/@huggingface/transformers/types/models/auto/processing_auto.d.ts:32
1 ../node_modules/.pnpm/@huggingface+transformers@3.7.2/node_modules/@huggingface/transformers/types/models/mgp_str/processing_mgp_str.d.ts:52
1 ../node_modules/.pnpm/@huggingface+transformers@3.7.2/node_modules/@huggingface/transformers/types/utils/maths.d.ts:116
1 ../node_modules/.pnpm/@huggingface+transformers@3.7.2/node_modules/@huggingface/transformers/types/utils/tensor.d.ts:160
ELIFECYCLE Command failed with exit code 2.```
julijan