mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-24 19:43:35 +00:00
[js/web] fix file size trim for wasm only .min.js (#16681)
### Description fix file size trim for wasm only .min.js minimal build `ort.wasm.min.js` and `ort.wasm-core.min.js` should exclude JSEP related source code.
This commit is contained in:
parent
5de2e2fb76
commit
d1d65978f6
1 changed files with 7 additions and 3 deletions
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
import {Env, InferenceSession, Tensor} from 'onnxruntime-common';
|
||||
|
||||
import {init as initJsep} from './jsep/init';
|
||||
import {SerializableModeldata, SerializableSessionMetadata, SerializableTensor} from './proxy-messages';
|
||||
import {setRunOptions} from './run-options';
|
||||
import {setSessionOptions} from './session-options';
|
||||
|
|
@ -51,8 +50,13 @@ export const initRuntime = async(env: Env): Promise<void> => {
|
|||
// init ORT
|
||||
initOrt(env.wasm.numThreads!, logLevelStringToEnum(env.logLevel));
|
||||
|
||||
// init JSEP if available
|
||||
await initJsep(getInstance(), env);
|
||||
if (!BUILD_DEFS.DISABLE_WEBGPU) {
|
||||
// init JSEP if available
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
||||
const initJsep = require('./jsep/init').init;
|
||||
await initJsep(getInstance(), env);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue