@jseeio/jsee 0.3.4 → 0.3.7

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.
package/src/main.js CHANGED
@@ -439,13 +439,15 @@ export default class JSEE {
439
439
  this.pipeline = (inputs) => inputs
440
440
  // Async for-loop over this.model (again)
441
441
  for (const [i, m] of this.model.entries()) {
442
- log('Initilizing the pipeline with model:', i)
442
+ log('Initilizing the pipeline with model:', i, m.type)
443
443
  let modelFunc
444
444
  if (m.worker) {
445
445
  // Init worker model
446
+ log('Initializing model in a worker:', m.name || m.url)
446
447
  modelFunc = await this.initWorker(m)
447
448
  } else {
448
449
  // Init specific model types
450
+ log('Initializing model in the main thread:', m.name || m.url)
449
451
  switch (m.type) {
450
452
  case 'py':
451
453
  modelFunc = await this.initPython(m)
@@ -461,6 +463,7 @@ export default class JSEE {
461
463
  break
462
464
  case 'get':
463
465
  case 'post':
466
+ log('Initializing API model')
464
467
  modelFunc = await this.initAPI(m)
465
468
  break
466
469
  default:
@@ -607,14 +610,15 @@ export default class JSEE {
607
610
  return modelFunc
608
611
  }
609
612
 
610
- initAPI () {
613
+ initAPI (model) {
614
+ log('Initializing API model:', model)
611
615
  this.overlay.hide()
612
- if (this.schema.model.worker) {
616
+ if (model.worker) {
613
617
  // Worker:
614
- this.worker.postMessage(this.schema.model)
618
+ this.worker.postMessage(model)
615
619
  } else {
616
620
  // Main:
617
- return utils.getModelFuncAPI(this.schema.model, log)
621
+ return utils.getModelFuncAPI(model, log)
618
622
  }
619
623
  }
620
624