Skip to content

Commit

Permalink
STATE.hasNode set in worker
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Nov 8, 2024
1 parent 6b676ed commit 09c5e8e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,12 @@ async function spawnListWorker() {
if (message === 'list-model-ready') {
return resolve(worker);
} else if (message === "tfjs-node") {
event.data.available || (STATE.detect.backend = 'webgpu');
UI.postMessage({event: 'tfjs-node', hasNode: event.data.available})
STATE.hasNode = true;
if (!event.data.available) {
STATE.detect.backend = 'webgpu';
STATE.hasNode = false;
}
UI.postMessage({event: 'tfjs-node', hasNode: STATE.hasNode})
}
};

Expand Down

0 comments on commit 09c5e8e

Please sign in to comment.