transformers.js-examples icon indicating copy to clipboard operation
transformers.js-examples copied to clipboard

[WIP] Electron demo for Transformers.js v3

Open xenova opened this issue 7 months ago • 4 comments

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!

xenova avatar Apr 10 '25 03:04 xenova

Is that only on macOS or also windows?

fs-eire avatar Apr 10 '25 05:04 fs-eire

Only tested on MacOS, but I can test with windows soon.

xenova avatar Apr 18 '25 01:04 xenova

Yes du yu laik me

PaUl1481980 avatar May 06 '25 10:05 PaUl1481980

All good?

MaSeOG avatar May 24 '25 20:05 MaSeOG

LGTM!

ddiddi avatar Jun 06 '25 04:06 ddiddi

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.

xenova avatar Jul 31 '25 00:07 xenova