xenova / transformers.js

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!
https://huggingface.co/docs/transformers.js
Apache License 2.0
9.81k stars 578 forks source link

v3: Onnx createInferenceSession wasmPaths and logLevel #744

Open Th3G33k opened 1 month ago

Th3G33k commented 1 month ago

With v3, in web environment, using relative path (eg 'dist', '/dist') for env.backends.onnx.wasm.wasmPaths, doesn't seem to work.

Uncaught (in promise) Error: no available backend found. ERR: [wasm] TypeError: Failed to execute 'fetch' on 'WorkerGlobalScope': Failed to parse URL from dist/v3/ort-wasm-simd.jsep.wasm

This PR should fix it.