mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Fix Node JS Samples (#23581)
### Description The Node JS Samples included in the repository have outdated package references that are broken, which are fixed in this PR. ### Motivation and Context The samples included in this repository should just work, but sadly do not. The reason is that they are using very outdated references for the npm modules. This fix updates the dependencies to the current onnxruntime-node, which fixes the samples. Also adds a small update to the .gitignore to exclude the node_modules directories in the samples directory, which keeps the local repo changelist cleaner.
This commit is contained in:
parent
6b4f9c481d
commit
cd8775f518
7 changed files with 8 additions and 7 deletions
3
samples/nodejs/.gitignore
vendored
3
samples/nodejs/.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
|||
!**/*.onnx
|
||||
package-lock.json
|
||||
package-lock.json
|
||||
node_modules
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
'use strict';
|
||||
const ort = require('onnxruntime');
|
||||
const ort = require('onnxruntime-node');
|
||||
|
||||
// use an async context to call onnxruntime functions.
|
||||
async function main() {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"onnxruntime": "0.0.1-dev.20200429.2"
|
||||
"onnxruntime-node": "^1.20.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
'use strict';
|
||||
const Tensor = require('onnxruntime').Tensor;
|
||||
const Tensor = require('onnxruntime-node').Tensor;
|
||||
|
||||
//
|
||||
// create a [2x3x4] float tensor
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"onnxruntime": "0.0.1-dev.20200429.2"
|
||||
"onnxruntime-node": "^1.20.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
const fs = require('fs');
|
||||
const util = require('util');
|
||||
const InferenceSession = require('onnxruntime').InferenceSession;
|
||||
const InferenceSession = require('onnxruntime-node').InferenceSession;
|
||||
|
||||
// use an async context to call onnxruntime functions.
|
||||
async function main() {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"onnxruntime": "0.0.1-dev.20200429.2"
|
||||
"onnxruntime-node": "^1.20.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue