Skip to content

Commit bf73184

Browse files
committed
2 parents 7f04cd0 + d4a2281 commit bf73184

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/backends/onnx.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,13 @@ if (ONNX_ENV?.wasm) {
193193
// By default, we only do this if we are not in a service worker and the wasmPaths are not already set.
194194
if (
195195
// @ts-ignore Cannot find name 'ServiceWorkerGlobalScope'.ts(2304)
196-
!(typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope) &&
197-
env.backends.onnx.versions?.web &&
198-
!ONNX_ENV.wasm.wasmPaths
196+
(
197+
!(typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope) &&
198+
ONNX_ENV.versions?.web &&
199+
!ONNX_ENV.wasm.wasmPaths
200+
)
199201
) {
200-
const wasmPathPrefix = `https://cdn.jsdelivr.net/npm/onnxruntime-web@${env.backends.onnx.versions.web}/dist/`;
202+
const wasmPathPrefix = `https://cdn.jsdelivr.net/npm/onnxruntime-web@${ONNX_ENV.versions.web}/dist/`;
201203

202204
ONNX_ENV.wasm.wasmPaths = apis.IS_SAFARI
203205
? {

0 commit comments

Comments
 (0)