Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/backends/onnx.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,13 @@ if (ONNX_ENV?.wasm) {
// By default, we only do this if we are not in a service worker and the wasmPaths are not already set.
if (
// @ts-ignore Cannot find name 'ServiceWorkerGlobalScope'.ts(2304)
!(typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope) &&
env.backends.onnx.versions?.web &&
!ONNX_ENV.wasm.wasmPaths
(
!(typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope) &&
ONNX_ENV.versions?.web &&
!ONNX_ENV.wasm.wasmPaths
)
) {
const wasmPathPrefix = `https://cdn.jsdelivr.net/npm/onnxruntime-web@${env.backends.onnx.versions.web}/dist/`;
const wasmPathPrefix = `https://cdn.jsdelivr.net/npm/onnxruntime-web@${ONNX_ENV.versions.web}/dist/`;

ONNX_ENV.wasm.wasmPaths = apis.IS_SAFARI
? {
Expand Down
Loading