onnxruntime/js/web/test/e2e
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
..
.gitignore
browser-test-wasm-image-tensor-image.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
browser-test-wasm-multi-session-create.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
browser-test-wasm-no-threads.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
browser-test-wasm-path-override-filename.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
browser-test-wasm-path-override-prefix.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
browser-test-wasm-proxy-no-threads.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
browser-test-wasm-proxy.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
browser-test-wasm.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
browser-test-webgl.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
browser-test-webgpu-external-data.js [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
common.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
karma.conf.js [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
model.onnx
model_with_orig_ext_data.bin [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
model_with_orig_ext_data.onnx [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
node-test-main-no-threads.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
node-test-main.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
node-test-wasm-path-override-filename.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
node-test-wasm-path-override-prefix.js [js] enable formatter for more file types (#16888) 2023-07-28 15:46:58 -07:00
package.json [js/web] enable webgpu in browser unit test (#16310) 2023-08-08 11:45:04 -07:00
run.js [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
simple-http-server.js [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00