onnxruntime-node 1.17.3 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/dist/version.js CHANGED
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.version = void 0;
6
6
  // This file is generated by /js/scripts/update-version.ts
7
7
  // Do not modify file content manually.
8
- exports.version = '1.17.3';
8
+ exports.version = '1.18.0';
9
9
  //# sourceMappingURL=version.js.map
package/lib/version.ts CHANGED
@@ -4,4 +4,4 @@
4
4
  // This file is generated by /js/scripts/update-version.ts
5
5
  // Do not modify file content manually.
6
6
 
7
- export const version = '1.17.3';
7
+ export const version = '1.18.0';
package/package.json CHANGED
@@ -13,9 +13,9 @@
13
13
  3
14
14
  ]
15
15
  },
16
- "version": "1.17.3",
16
+ "version": "1.18.0",
17
17
  "dependencies": {
18
- "onnxruntime-common": "1.17.3",
18
+ "onnxruntime-common": "1.18.0",
19
19
  "tar": "^7.0.1"
20
20
  },
21
21
  "scripts": {
package/script/build.js CHANGED
@@ -47,6 +47,8 @@ if (ARCH !== 'x64' && ARCH !== 'ia32' && ARCH !== 'arm64' && ARCH !== 'arm') {
47
47
  }
48
48
  // --onnxruntime-build-dir=
49
49
  const ONNXRUNTIME_BUILD_DIR = buildArgs['onnxruntime-build-dir'];
50
+ // --onnxruntime-generator=
51
+ const ONNXRUNTIME_GENERATOR = buildArgs['onnxruntime-generator'];
50
52
  // --rebuild
51
53
  const REBUILD = !!buildArgs.rebuild;
52
54
  // --use_dml
@@ -76,6 +78,9 @@ const args = [
76
78
  if (ONNXRUNTIME_BUILD_DIR && typeof ONNXRUNTIME_BUILD_DIR === 'string') {
77
79
  args.push(`--CDONNXRUNTIME_BUILD_DIR=${ONNXRUNTIME_BUILD_DIR}`);
78
80
  }
81
+ if (ONNXRUNTIME_GENERATOR && typeof ONNXRUNTIME_GENERATOR === 'string') {
82
+ args.push(`--CDONNXRUNTIME_GENERATOR=${ONNXRUNTIME_GENERATOR}`);
83
+ }
79
84
  if (USE_DML) {
80
85
  args.push('--CDUSE_DML=ON');
81
86
  }
package/script/build.ts CHANGED
@@ -23,6 +23,8 @@ if (ARCH !== 'x64' && ARCH !== 'ia32' && ARCH !== 'arm64' && ARCH !== 'arm') {
23
23
  }
24
24
  // --onnxruntime-build-dir=
25
25
  const ONNXRUNTIME_BUILD_DIR = buildArgs['onnxruntime-build-dir'];
26
+ // --onnxruntime-generator=
27
+ const ONNXRUNTIME_GENERATOR = buildArgs['onnxruntime-generator'];
26
28
  // --rebuild
27
29
  const REBUILD = !!buildArgs.rebuild;
28
30
  // --use_dml
@@ -55,6 +57,9 @@ const args = [
55
57
  if (ONNXRUNTIME_BUILD_DIR && typeof ONNXRUNTIME_BUILD_DIR === 'string') {
56
58
  args.push(`--CDONNXRUNTIME_BUILD_DIR=${ONNXRUNTIME_BUILD_DIR}`);
57
59
  }
60
+ if (ONNXRUNTIME_GENERATOR && typeof ONNXRUNTIME_GENERATOR === 'string') {
61
+ args.push(`--CDONNXRUNTIME_GENERATOR=${ONNXRUNTIME_GENERATOR}`);
62
+ }
58
63
  if (USE_DML) {
59
64
  args.push('--CDUSE_DML=ON');
60
65
  }
package/script/install.js CHANGED
@@ -29,6 +29,8 @@ const {Readable} = require('stream');
29
29
  // --onnxruntime-node-install-cuda=v12 Force install the CUDA EP binaries for CUDA 12.
30
30
  // --onnxruntime-node-install-cuda=skip Skip the installation of the CUDA EP binaries.
31
31
  //
32
+ // Alternatively, use environment variable "ONNXRUNTIME_NODE_INSTALL_CUDA"
33
+ //
32
34
  // If the flag is not provided, the script will only install the CUDA EP binaries when:
33
35
  // - The platform is Linux/x64.
34
36
  // - The binaries are not already present in the package.
@@ -58,7 +60,7 @@ if (NO_INSTALL || !shouldInstall) {
58
60
  const artifactUrl = {
59
61
  11: `https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VERSION}/onnxruntime-linux-x64-gpu-${
60
62
  ORT_VERSION}.tgz`,
61
- 12: `https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VERSION}/onnxruntime-linux-x64-cuda12-${
63
+ 12: `https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VERSION}/onnxruntime-linux-x64-gpu-cuda12-${
62
64
  ORT_VERSION}.tgz`
63
65
  }[INSTALL_CUDA_FLAG || tryGetCudaVersion()];
64
66
  console.log(`Downloading "${artifactUrl}"...`);
@@ -79,15 +81,19 @@ Use "--onnxruntime-node-install-cuda=skip" to skip the installation. You will st
79
81
  ]);
80
82
 
81
83
  Readable.fromWeb(res.body)
82
- .pipe(tar.t())
83
- .on('entry',
84
- (entry) => {
85
- const filename = path.basename(entry.path);
86
- if (entry.type === 'File' && FILES.has(filename)) {
87
- console.log(`Extracting "${filename}" to "${BIN_FOLDER}"...`);
88
- entry.pipe(fs.createWriteStream(path.join(BIN_FOLDER, filename)));
89
- }
90
- })
84
+ .pipe(tar.t({
85
+ strict: true,
86
+ onentry: (entry) => {
87
+ const filename = path.basename(entry.path);
88
+ if (entry.type === 'File' && FILES.has(filename)) {
89
+ console.log(`Extracting "${filename}" to "${BIN_FOLDER}"...`);
90
+ entry.pipe(fs.createWriteStream(path.join(BIN_FOLDER, filename)));
91
+ entry.on('finish', () => {
92
+ console.log(`Finished extracting "${filename}".`);
93
+ });
94
+ }
95
+ }
96
+ }))
91
97
  .on('error', (err) => {
92
98
  throw new Error(`Failed to extract the binaries: ${err.message}.
93
99
 
@@ -105,7 +111,7 @@ function tryGetCudaVersion() {
105
111
  }
106
112
 
107
113
  function parseInstallCudaFlag() {
108
- let flag = process.env.npm_config_onnxruntime_node_install_cuda;
114
+ let flag = process.env.ONNXRUNTIME_NODE_INSTALL_CUDA || process.env.npm_config_onnxruntime_node_install_cuda;
109
115
  if (!flag) {
110
116
  for (let i = 0; i < process.argv.length; i++) {
111
117
  if (process.argv[i].startsWith('--onnxruntime-node-install-cuda=')) {
@@ -118,6 +124,8 @@ function parseInstallCudaFlag() {
118
124
  }
119
125
  switch (flag) {
120
126
  case 'true':
127
+ case '1':
128
+ case 'ON':
121
129
  return tryGetCudaVersion();
122
130
  case 'v11':
123
131
  return 11;