From 3c8b15e39e929d13b49a09f284350cec1c819887 Mon Sep 17 00:00:00 2001 From: lsb Date: Fri, 30 Jun 2023 18:28:49 -0700 Subject: [PATCH] Update onnx.js (#174) * Update onnx.js * Update regex test for iOS 16.4 user agent --------- Co-authored-by: Joshua Lochner --- src/backends/onnx.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/onnx.js b/src/backends/onnx.js index 5db22d1..a06beb0 100644 --- a/src/backends/onnx.js +++ b/src/backends/onnx.js @@ -40,10 +40,10 @@ if (typeof process !== 'undefined' && process?.release?.name === 'node') { // Running in a browser-environment ONNX = ONNX_WEB.default ?? ONNX_WEB; - // SIMD for WebAssembly does not operate correctly in recent versions of iOS (>= 16.4). + // SIMD for WebAssembly does not operate correctly in some recent versions of iOS (16.4.x). // As a temporary fix, we disable it for now. // For more information, see: https://github.com/microsoft/onnxruntime/issues/15644 - const isIOS = typeof navigator !== 'undefined' && /iP(hone|od|ad)/.test(navigator.userAgent); + const isIOS = typeof navigator !== 'undefined' && /iP(hone|od|ad).+16_4.+AppleWebKit/.test(navigator.userAgent); if (isIOS) { ONNX.env.wasm.simd = false; }