-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Question
I'm trying to bundle a Node.js CLI tool that uses @xenova/transformers into a single executable using pkg.
The build works fine, but when I run the packaged executable, I get this error:
Error: Cannot find module '../bin/napi-v3/linux/x64/onnxruntime_binding.node'
Require stack:
- /snapshot/custom-cli/node_modules/onnxruntime-node/dist/binding.js
- /snapshot/custom-cli/node_modules/onnxruntime-node/dist/backend.js
- /snapshot/custom-cli/node_modules/onnxruntime-node/dist/index.js
- /snapshot/custom-cli/dist/custom-cli.cjs
Build command:
webpack && pkg -t node18-linux -o custom-cli dist/custom-cli.cjs
pkg config:
"pkg": {
"assets": [
"node_modules/onnxruntime-node/bin/napi-v3/**/onnxruntime_binding.node"
]
}
Is it possible to give a custom absolute path for ONNX native bindings (something like this):
import { env } from "@xenova/transformers";
env.backends.onnx.customBindingPath = "/custom-cli/onnxruntime_binding.node";
then the tool could:
-
Extract prebuilt binaries (onnxruntime_binding.node) from a known location (or GitHub ZIP)
-
Pass that custom path to @xenova/transformers / onnxruntime-node
-
Load correctly even when packaged by pkg
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested