Update onnx.js (#174)

* Update onnx.js

* Update regex test for iOS 16.4 user agent

---------

Co-authored-by: Joshua Lochner <admin@xenova.com>
This commit is contained in:
lsb 2023-06-30 18:28:49 -07:00 committed by GitHub
parent 1bf7958cfa
commit 3c8b15e39e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}