Use transformers WASM binaries from a local folder

This commit is contained in:
Cohee
2023-09-14 14:11:37 +03:00
parent c4c962aeb9
commit 179de92231
5 changed files with 62 additions and 1 deletions

View File

@@ -4,6 +4,8 @@ import { getConfig } from './util.js';
// Limit the number of threads to 1 to avoid issues on Android
env.backends.onnx.wasm.numThreads = 1;
// Use WASM from a local folder to avoid CDN connections
env.backends.onnx.wasm.wasmPaths = path.join(process.cwd(), 'dist') + path.sep;
class PipelineAccessor {
/**

View File

@@ -4,6 +4,8 @@ import { getConfig } from './util.js';
// Limit the number of threads to 1 to avoid issues on Android
env.backends.onnx.wasm.numThreads = 1;
// Use WASM from a local folder to avoid CDN connections
env.backends.onnx.wasm.wasmPaths = path.join(process.cwd(), 'dist') + path.sep;
class PipelineAccessor {
/**