Closed
Description
Describe the issue
Until version "onnxruntime-web": "1.17.1"
I have set the links to my wasm files like this:
ort.env.wasm.wasmPaths = {
'ort-wasm.wasm': '/sam/ort-wasm.wasm',
'ort-wasm-simd.wasm': '/sam/ort-wasm-simd.wasm',
'ort-wasm-simd-threaded.wasm': '/sam/ort-wasm-simd-threaded.wasm',
'ort-wasm-threaded.wasm': '/sam/ort-wasm-threaded.wasm'
}
// create inferenceSession and set model
useEffect(() => {
// Initialize the ONNX model
const initModel = async () => {
try {
const URL: string = `${window.location.origin}${globalConfig.get().ONNX_MODEL_PATH}`
const model = await InferenceSession.create(URL)
setModel(model)
} catch (e) {
console.log(e)
}
}
if (!model) {
initModel()
}
}, [])
I have updated to version "onnxruntime-web 1.20.1 and apparently the type of wasmPaths changed.
Also no backend is found anymore. This error is logged in the console when mounting the component where I have the above mentioned code.
The wasm files are saved in public/sam
I'd be happy for some hints on how to change the setup. Thanks!
To reproduce
Setup React project with vite
Setup:
- React 18.2.0
- Typescript: 4.9.5
- Vite 4.5.5
- "onnxruntime-web": "1.17.1",
- copy wasm files to /public
- set ort.env.wasm.wasmPaths
- create model
Urgency
I can sty on 1.17.1 for now but would still like to know what I need to change
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.17.1
Execution Provider
'wasm'/'cpu' (WebAssembly CPU)