Hello
I’m trying to integrate transformers.js into my Electron Forge app to run the pipeline on the main process (not the renderer).
I’ve copy-pasted the example code from the electron example in the Transformers.js Repo.
Here’s a minimalist version of my project that demonstrates the problem. Just run npm i && npm run start
and look at the node output.
When running the pipeline I’m getting the following error:
removing requested execution provider "wasm" from session options because it is not available: backend not found.
An error occurred during model execution: "TypeError: Tensor.data must be a typed array for numeric tensor.".
Inputs given to model: [Object: null prototype] {
input_ids: Tensor {
dims: [ 1, 3 ],
type: 'int64',
data: undefined,
size: 3,
cpuData: BigInt64Array(3) [ 101n, 7592n, 102n ],
dataLocation: 'cpu'
},
attention_mask: Tensor {
dims: [ 1, 3 ],
type: 'int64',
data: undefined,
size: 3,
cpuData: BigInt64Array(3) [ 1n, 1n, 1n ],
dataLocation: 'cpu'
}
}
Error occurred in handler for 'run-ai': TypeError: Tensor.data must be a typed array for numeric tensor.
at Immediate.<anonymous> (C:\path\to\project\transformers-test-project\node_modules\onnxruntime-node\dist\backend.js:45:108)
at process.processImmediate (node:internal/timers:476:21)
The biggest difference between my project and the example project is, that I use webpack to bundle the code - I could imagine it’s a config issue.
It looks like it downloads the model fine, it just crashes when running the pipeline.
I’m on Windows 11
Nodejs v18.19.1
I appreciate any help!
HF beginner here - please forgive any obvious mistakes.