diff --git a/js/web/lib/backend-wasm-with-training.ts b/js/web/lib/backend-wasm-with-training.ts index 5fac10da7791d..af5b575c87a7f 100644 --- a/js/web/lib/backend-wasm-with-training.ts +++ b/js/web/lib/backend-wasm-with-training.ts @@ -6,14 +6,12 @@ import {InferenceSession, TrainingSessionHandler} from 'onnxruntime-common'; import {OnnxruntimeWebAssemblyBackend} from './backend-wasm'; class OnnxruntimeTrainingWebAssemblyBackend extends OnnxruntimeWebAssemblyBackend { - /* eslint-disable @typescript-eslint/no-unused-vars */ async createTrainingSessionHandler( - checkpointStateUriOrBuffer: string|Uint8Array, trainModelUriOrBuffer: string|Uint8Array, - evalModelUriOrBuffer: string|Uint8Array, optimizerModelUriOrBuffer: string|Uint8Array, - options: InferenceSession.SessionOptions): Promise { + _checkpointStateUriOrBuffer: string|Uint8Array, _trainModelUriOrBuffer: string|Uint8Array, + _evalModelUriOrBuffer: string|Uint8Array, _optimizerModelUriOrBuffer: string|Uint8Array, + _options: InferenceSession.SessionOptions): Promise { throw new Error('Method not implemented yet.'); } - /* eslint-enable @typescript-eslint/no-unused-vars */ } export const wasmBackend = new OnnxruntimeTrainingWebAssemblyBackend(); diff --git a/js/web/lib/wasm/wasm-factory.ts b/js/web/lib/wasm/wasm-factory.ts index 1ce06b0f63b88..08192b4174272 100644 --- a/js/web/lib/wasm/wasm-factory.ts +++ b/js/web/lib/wasm/wasm-factory.ts @@ -77,9 +77,9 @@ const isSimdSupported = (): boolean => { } }; -const getWasmFileName = (useSimd: boolean, useThreads: boolean, useTraining: boolean) => { +const getWasmFileName = (useSimd: boolean, useThreads: boolean) => { if (useSimd) { - if (useTraining) { + if (BUILD_DEFS.ENABLE_TRAINING) { return 'ort-training-wasm-simd.wasm'; } return useThreads ? 'ort-wasm-simd-threaded.wasm' : 'ort-wasm-simd.wasm'; @@ -111,7 +111,7 @@ export const initializeWebAssembly = async(flags: Env.WebAssemblyFlags): Promise const wasmPaths = flags.wasmPaths; const wasmPrefixOverride = typeof wasmPaths === 'string' ? wasmPaths : undefined; - const wasmFileName = getWasmFileName(useSimd, useThreads, BUILD_DEFS.ENABLE_TRAINING); + const wasmFileName = getWasmFileName(useSimd, useThreads); const wasmPathOverride = typeof wasmPaths === 'object' ? wasmPaths[wasmFileName] : undefined; let isTimeout = false; diff --git a/js/web/webpack.config.js b/js/web/webpack.config.js index 1ac421b5246d9..28d30604dc8d3 100644 --- a/js/web/webpack.config.js +++ b/js/web/webpack.config.js @@ -298,6 +298,8 @@ module.exports = () => { build_defs: { ...DEFAULT_BUILD_DEFS, ENABLE_TRAINING: true, + DISABLE_WEBGL: true, + DISABLE_WEBGPU: true, } }), );