Skip to content

Commit

Permalink
[js/web] allow relative path matching (#21657)
Browse files Browse the repository at this point in the history
### Description
<!-- Describe your changes. -->

This change allows to match external data path like `a.data` to
`./a.data`.


<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
  • Loading branch information
fs-eire authored Aug 9, 2024
1 parent ae2b4d3 commit f4ec852
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions onnxruntime/wasm/pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* @param {Uint8Array} externalDataFilesData
*/
Module['mountExternalData'] = (externalDataFilePath, externalDataFileData) => {
if (externalDataFilePath.startsWith('./')) {
externalDataFilePath = externalDataFilePath.substring(2);
}
const files = Module.MountedFiles || (Module.MountedFiles = new Map());
files.set(externalDataFilePath, externalDataFileData);
};
Expand Down

0 comments on commit f4ec852

Please sign in to comment.