onnxruntime/js/web/script
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
..
build.ts [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
generate-webgl-operator-md.ts [js/webgpu] generate operator table for webgpu (#15954) 2023-05-20 12:20:41 -07:00
generate-webgpu-operator-md.ts [js/web] JSEP Attention & MultiHeadAttention (#17742) 2023-11-17 12:23:52 -08:00
parse-profiler.ts [JS/Web] WebGL Profiling Tool (#7724) 2021-05-18 06:31:00 -07:00
prepack.ts [js] update prepack script to use exact version (#17484) 2023-09-13 00:07:16 -07:00
pull-prebuilt-wasm-artifacts.ts Add training WASM generation to Web CI pipeline (#17319) 2023-09-08 15:49:47 -07:00
test-runner-cli-args.ts [WebNN] Enable npm unit tests (#18486) 2024-01-09 10:10:57 -08:00
test-runner-cli.ts [WebNN] Enable npm unit tests (#18486) 2024-01-09 10:10:57 -08:00
tsconfig.json [js/web] set noUnusedParameters to true and fix a few bugs (#18404) 2023-11-15 09:16:29 -08:00