Skip to content

Commit a6873bc

Browse files
committed
[DO NOT MERGE] fix export
1 parent 026e89f commit a6873bc

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

examples/extension/src/background.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env.allowLocalModels = false;
77

88
// Due to a bug in onnxruntime-web, we must disable multithreading for now.
99
// See https://github.com/microsoft/onnxruntime/issues/14445 for more information.
10-
env.backends.onnx.wasm.numThreads = 1;
10+
//env.backends.onnx.wasm.numThreads = 1;
1111

1212

1313
class PipelineSingleton {

src/backends/onnx.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ if (ONNX_ENV?.wasm) {
179179
// https://onnxruntime.ai/docs/api/js/interfaces/Env.WebAssemblyFlags.html#wasmPaths
180180
// We use remote wasm files by default to make it easier for newer users.
181181
// In practice, users should probably self-host the necessary .wasm files.
182-
ONNX_ENV.wasm.wasmPaths = `https://cdn.jsdelivr.net/npm/@huggingface/transformers@${env.version}/dist/`;
182+
// ONNX_ENV.wasm.wasmPaths = `https://cdn.jsdelivr.net/npm/@huggingface/transformers@${env.version}/dist/`;
183183

184184
// TODO: Add support for loading WASM files from cached buffer when we upgrade to [email protected]
185185
// https://github.com/microsoft/onnxruntime/pull/21534
@@ -189,9 +189,9 @@ if (ONNX_ENV?.wasm) {
189189
ONNX_ENV.wasm.proxy = false;
190190

191191
// https://developer.mozilla.org/en-US/docs/Web/API/crossOriginIsolated
192-
if (typeof crossOriginIsolated === 'undefined' || !crossOriginIsolated) {
193-
ONNX_ENV.wasm.numThreads = 1;
194-
}
192+
// if (typeof crossOriginIsolated === 'undefined' || !crossOriginIsolated) {
193+
// ONNX_ENV.wasm.numThreads = 1;
194+
// }
195195
}
196196

197197
if (ONNX_ENV?.webgpu) {

webpack.config.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function buildConfig({
4242
type,
4343
},
4444
assetModuleFilename: "[name][ext]",
45-
chunkFormat: "module",
45+
chunkFormat: false,
4646
},
4747
optimization: {
4848
minimize: true,
@@ -78,13 +78,13 @@ function buildConfig({
7878
};
7979

8080
if (outputModule) {
81-
config.module = {
82-
parser: {
83-
javascript: {
84-
importMeta: false,
85-
},
86-
},
87-
};
81+
// config.module = {
82+
// parser: {
83+
// javascript: {
84+
// importMeta: false,
85+
// },
86+
// },
87+
// };
8888
} else {
8989
config.externalsType = "commonjs";
9090
}

0 commit comments

Comments
 (0)