transformers.js-examples
transformers.js-examples copied to clipboard
[WIP] Electron demo for Transformers.js v3
Running with npm run start works well, but I'm still running into issues when building the application with npm run make.
First:
Uncaught Exception: Error: dlopen(.../electron.app/Contents/Resources/app.asar.unpacked/node_modules/onnxruntime-node/bin/napi-v3/darwin/arm64/onnxruntime_binding.node, 0x0001): Library not loaded: @rpath/libonnxruntime.1.21.0.dylib
This error can be fixed by adding an override to asar in the electron forge config:
asar: {
// Include the native modules in the asar archive
// https://www.electronforge.io/config/plugins/auto-unpack-natives#usage
unpack: "{**/{.**,**}/**/*.node,**/{.**,**}/**/*.dylib}",
},
The next error is more serious... leading to a complete crash with a not-very-readable debug log. The messages still refer to onnxruntime-node, which seems to be the root issue. @fs-eire, I was hoping you could assist in debugging this, since it looks like this affects all electron developers building for production. Thanks!
Is that only on macOS or also windows?
Only tested on MacOS, but I can test with windows soon.
Yes du yu laik me
All good?
LGTM!
Merging for now -- haven't been able to test on windows yet, but npm run start works well. Hoping to solve the building on mac soon.