onnxruntime/js/common/lib
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
..
backend-impl.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
backend.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
env-impl.ts [js/common] allow import onnxruntime-common as ESM and CJS (#15772) 2023-06-12 12:05:11 -07:00
env.ts [js/webgpu] Introduce trace support (#18928) 2024-01-03 10:13:17 -08:00
index.ts [js/webgpu] Introduce trace support (#18928) 2024-01-03 10:13:17 -08:00
inference-session-impl.ts [js/webgpu] Introduce trace support (#18928) 2024-01-03 10:13:17 -08:00
inference-session.ts [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
onnx-model.ts [js] enable external data loading for ort-web (#19087) 2024-01-12 19:24:24 -08:00
onnx-value.ts [js/api] introducing IO binding for tensor (#16452) 2023-08-29 12:58:26 -07:00
tensor-conversion-impl.ts [js] using OffscreenCanvas when DOM is not available (#19033) 2024-01-12 13:54:05 -08:00
tensor-conversion.ts [js/common] allow import onnxruntime-common as ESM and CJS (#15772) 2023-06-12 12:05:11 -07:00
tensor-factory-impl.ts [js] using OffscreenCanvas when DOM is not available (#19033) 2024-01-12 13:54:05 -08:00
tensor-factory.ts [js/common] prepare work for supporting webgpu IO binding implementation (#17465) 2023-09-08 13:49:24 -07:00
tensor-impl-type-mapping.ts [js/api] introducing IO binding for tensor (#16452) 2023-08-29 12:58:26 -07:00
tensor-impl.ts [js/common] prepare work for supporting webgpu IO binding implementation (#17465) 2023-09-08 13:49:24 -07:00
tensor-utils-impl.ts [js/api] introducing IO binding for tensor (#16452) 2023-08-29 12:58:26 -07:00
tensor-utils.ts [js/common] allow import onnxruntime-common as ESM and CJS (#15772) 2023-06-12 12:05:11 -07:00
tensor.ts [js/common] prepare work for supporting webgpu IO binding implementation (#17465) 2023-09-08 13:49:24 -07:00
trace.ts [js/webgpu] Introduce trace support (#18928) 2024-01-03 10:13:17 -08:00
training-session-impl.ts [js/web/training] lazyResetGrad implementation (#18711) 2023-12-11 17:36:54 -08:00
training-session.ts [js/web/training] lazyResetGrad implementation (#18711) 2023-12-11 17:36:54 -08:00
version.ts Bump Up Version to 1.17.0 (#17587) 2023-09-20 11:02:58 +08:00