mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-07 17:15:29 +00:00
[js/web] allow relative path matching (#21657)
### 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. -->
This commit is contained in:
parent
ae2b4d31ea
commit
f4ec85259a
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue