-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
24 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,12 @@ export default defineConfig(env => { | |
} | ||
}; | ||
|
||
// TODO: Add the following when using [email protected] | ||
// if (env.mode === 'development') { | ||
// // The .wasm files are not correctly served using Vite in development mode. | ||
// // This is a workaround to exclude the onnxruntime-web package from Vite's optimization. | ||
// // See also: https://github.com/vitejs/vite/issues/8427 | ||
// config.optimizeDeps = { exclude: ["onnxruntime-web"] }; | ||
// } | ||
if (env.mode === 'development') { | ||
// The .wasm files are not correctly served using Vite in development mode. | ||
// This is a workaround to exclude the onnxruntime-web package from Vite's optimization. | ||
// See also: https://github.com/vitejs/vite/issues/8427 | ||
config.optimizeDeps = { exclude: ["onnxruntime-web"] }; | ||
} | ||
|
||
return config; | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,11 +105,11 @@ const ONNX_ENV = ONNX?.env; | |
if (ONNX_ENV?.wasm) { | ||
// Initialize wasm backend with suitable default settings. | ||
|
||
// Set path to wasm files. This is needed when running in a web worker. | ||
// (Optional) Set path to wasm files. This is needed when running in a web worker. | ||
// https://onnxruntime.ai/docs/api/js/interfaces/Env.WebAssemblyFlags.html#wasmPaths | ||
// We use remote wasm files by default to make it easier for newer users. | ||
// In practice, users should probably self-host the necessary .wasm files. | ||
ONNX_ENV.wasm.wasmPaths = 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.18.0/dist/'; | ||
// ONNX_ENV.wasm.wasmPaths = 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.0-dev.20240804-ee2fe87e2d/dist/'; | ||
|
||
// TODO: Add support for loading WASM files from cached buffer when we upgrade to [email protected] | ||
// https://github.com/microsoft/onnxruntime/pull/21534 | ||
|