orchestrator-core
Advanced tools
Comparing version 4.11.2-dev.20201208.c620747 to 4.11.2-dev.20210112.a4baa98
@@ -5,3 +5,3 @@ { | ||
"description": "Orchestrator for Node.js", | ||
"version": "4.11.2-dev.20201208.c620747", | ||
"version": "4.11.2-dev.20210112.a4baa98", | ||
"license": "MIT", | ||
@@ -27,4 +27,3 @@ "keywords": [ | ||
"node-gyp": "^7.1.2", | ||
"node-pre-gyp": "^0.15.0", | ||
"onnxruntime": "1.4.0" | ||
"node-pre-gyp": "^0.15.0" | ||
}, | ||
@@ -31,0 +30,0 @@ "binary": { |
@@ -11,3 +11,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Begins looking "path_depth" directories from current directory. | ||
var findOnnxDir = function(path_depth) { | ||
var findOnnxDir = function(path_depth, baseModelName='pretrained.20200924.microsoft.dte.00.06.en.onnx') { | ||
var cwd = process.cwd(); | ||
@@ -24,3 +24,3 @@ var i; | ||
var model_dir = null; | ||
function validateConfigFile(model_dir) { | ||
function validateConfigFile(model_dir, baseModelName) { | ||
// console.log('ONNX: Found onnx file in ' + model_dir); | ||
@@ -35,5 +35,6 @@ try{ | ||
const config = JSON.parse(jsonData); | ||
if (config.hasOwnProperty('VocabFile') && config.hasOwnProperty('MergeFile') | ||
&& config.hasOwnProperty('ModelFile') && config.hasOwnProperty('Name')) { | ||
// console.log(' => VALID!'); | ||
if (config.hasOwnProperty('VocabFile') | ||
&& config.hasOwnProperty('ModelFile') && config.hasOwnProperty('Name') | ||
&& config.Name == baseModelName) { | ||
// console.log(' => VALID! Found model ' + baseModelName); | ||
return true; | ||
@@ -53,4 +54,3 @@ } | ||
function findModel(cwd) { | ||
function findModel(cwd, baseModelName) { | ||
fs.readdirSync(cwd).find( (dirInner) => { | ||
@@ -63,3 +63,3 @@ dirInner = cwd + sep + dirInner; | ||
!dirInner.endsWith("TestResults")) { // Don't bother looking in TestResults | ||
return findModel(dirInner); | ||
return findModel(dirInner, baseModelName); | ||
} | ||
@@ -71,3 +71,3 @@ | ||
dirInner = dtemp.join(sep); | ||
if (validateConfigFile(dirInner)) { | ||
if (validateConfigFile(dirInner, baseModelName)) { | ||
model_dir = dirInner; | ||
@@ -82,3 +82,4 @@ return true; | ||
} | ||
findModel(cwd); | ||
findModel(cwd, baseModelName); | ||
return model_dir; | ||
@@ -94,3 +95,3 @@ }; | ||
this.orchestrator = new oc.Orchestrator(); | ||
var onnx_dir = findOnnxDir(1); | ||
var onnx_dir = findOnnxDir(1, ); | ||
console.log(`DEBUGGING - nodejs - orchestrator-core: Orchestrator.before(): onnx_dir=${onnx_dir}`); | ||
@@ -97,0 +98,0 @@ fs.readdirSync(onnx_dir).forEach(file => { |
@@ -11,3 +11,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Begins looking "path_depth" directories from current directory. | ||
var findOnnxDir = function(path_depth) { | ||
var findOnnxDir = function(path_depth, baseModelName='pretrained.20200924.microsoft.dte.00.06.en.onnx') { | ||
var cwd = process.cwd(); | ||
@@ -24,3 +24,3 @@ var i; | ||
var model_dir = null; | ||
function validateConfigFile(model_dir) { | ||
function validateConfigFile(model_dir, baseModelName) { | ||
// console.log('ONNX: Found onnx file in ' + model_dir); | ||
@@ -35,5 +35,6 @@ try{ | ||
const config = JSON.parse(jsonData); | ||
if (config.hasOwnProperty('VocabFile') && config.hasOwnProperty('MergeFile') | ||
&& config.hasOwnProperty('ModelFile') && config.hasOwnProperty('Name')) { | ||
// console.log(' => VALID!'); | ||
if (config.hasOwnProperty('VocabFile') | ||
&& config.hasOwnProperty('ModelFile') && config.hasOwnProperty('Name') | ||
&& config.Name == baseModelName) { | ||
// console.log(' => VALID! Found model ' + baseModelName); | ||
return true; | ||
@@ -53,4 +54,3 @@ } | ||
function findModel(cwd) { | ||
function findModel(cwd, baseModelName) { | ||
fs.readdirSync(cwd).find( (dirInner) => { | ||
@@ -63,3 +63,3 @@ dirInner = cwd + sep + dirInner; | ||
!dirInner.endsWith("TestResults")) { // Don't bother looking in TestResults | ||
return findModel(dirInner); | ||
return findModel(dirInner, baseModelName); | ||
} | ||
@@ -71,3 +71,3 @@ | ||
dirInner = dtemp.join(sep); | ||
if (validateConfigFile(dirInner)) { | ||
if (validateConfigFile(dirInner, baseModelName)) { | ||
model_dir = dirInner; | ||
@@ -82,3 +82,4 @@ return true; | ||
} | ||
findModel(cwd); | ||
findModel(cwd, baseModelName); | ||
return model_dir; | ||
@@ -85,0 +86,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
822582
4
682
- Removedonnxruntime@1.4.0
- Removedbase64-js@1.5.1(transitive)
- Removedbl@4.1.0(transitive)
- Removedbuffer@5.7.1(transitive)
- Removeddecompress-response@4.2.1(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedexpand-template@2.0.3(transitive)
- Removedfs-constants@1.0.0(transitive)
- Removedgithub-from-package@0.0.0(transitive)
- Removedieee754@1.2.1(transitive)
- Removedmimic-response@2.1.0(transitive)
- Removedmkdirp-classic@0.5.3(transitive)
- Removednapi-build-utils@1.0.2(transitive)
- Removednode-abi@2.30.1(transitive)
- Removednoop-logger@0.1.1(transitive)
- Removedonnxruntime@1.4.0(transitive)
- Removedprebuild-install@5.3.6(transitive)
- Removedpump@3.0.2(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedsimple-get@3.1.1(transitive)
- Removedtar-fs@2.1.2(transitive)
- Removedtar-stream@2.2.0(transitive)
- Removedwhich-pm-runs@1.1.0(transitive)