onnxruntime/js/web/lib/wasm
Yulong Wang 07cfc56538
[js] enable external data loading for ort-web (#19087)
### Description
enable external data loading for ort-web.

### Why
The ORT external data design is highly depending on the file system,
especially synchronous file I/O APIs. Those are not available in web
platforms. We need to have extra code to make external data working on
web.

### How
Considering there is no file system in web, an implementation for web to
support external data is to use pre-loaded data. Assume model file
a.onnx includes initializers that linked to ./b.bin, we require users to
pass a full data file list when creating the session. The user code will
be look like:
```js
const mySess = await ort.InferenceSession.create('./path/model/a.onnx', {
  // session options
  externalData: [
    {
      // relative or absolute path/URL of the file,
      // or a pre-loaded Uint8Array containing the data of the external data file
      data: './path/data/b.bin', 

      // the relative path of the external data. Should match initializers' "location" value defined in the model file
      path: './b.bin'
    },
    // { } if multiple external data file
  ]
});
```

Currently, this feature only works with JSEP build enabled.
2024-01-12 19:24:24 -08:00
..
binding [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
jsep [js/webgpu] more fixes for access above 2GB (#19065) 2024-01-12 17:47:37 -08:00
proxy-worker [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
proxy-messages.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
proxy-wrapper.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
run-options.ts [js/web] enable ONNX Runtime Web error messages in JS (#16335) 2023-06-15 09:45:41 -07:00
session-handler-inference.ts [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
session-handler-training.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
session-options.ts [WebNN EP] Support numThreads option for WebNN CPU device (#18054) 2023-11-12 16:45:10 -08:00
wasm-common.ts [js/webgpu] support IO binding (#17480) 2023-09-29 11:24:42 -07:00
wasm-core-impl.ts [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
wasm-factory.ts [js/web] wait for threadpool initialization (#18952) 2024-01-04 08:06:55 -08:00
wasm-training-core-impl.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
wasm-utils-load-file.ts [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
wasm-utils.ts [js/web] enable ONNX Runtime Web error messages in JS (#16335) 2023-06-15 09:45:41 -07:00