[bug] window randomly restarts and freezes, possibly WASM related
WesWeCan opened this issue · 1 comments
Describe the bug
I am working on an application that uses whisper from transformers.js (which downloadss wasm files), in electron and the browser this issue doesn't exist.
I am not seeing any error messages in the console or in the terminal.
What I am seeing is that the page randomly refreshes, and sometimes just freezes or freezes to gray, which has me thinking it crashes for an unknown reason. Inspect element is also freezing then.
Reproduction
import { pipeline } from '@huggingface/transformers';
const transcriber = await pipeline('automatic-speech-recognition', 'onnx-community/whisper-base', {
// dtype: {
// encoder_model: 'fp32',
// decoder_model_merged: 'fp32',
// },
// device: 'webgpu' // not supported in MacOS
});
Just this and wait 10 - 60 seconds, and the app window freezes or restarts.
Expected behavior
No restarts / crashes
Full tauri info
output
[✔] Environment
- OS: Mac OS 15.2.0 arm64 (X64)
✔ Xcode Command Line Tools: installed
✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
✔ Rust toolchain: stable-aarch64-apple-darwin (default)
- node: 22.7.0
- yarn: 1.22.22
- npm: 10.8.2
[-] Packages
- tauri 🦀: 2.1.1
- tauri-build 🦀: 2.0.3
- wry 🦀: 0.47.2
- tao 🦀: 0.30.8
- @tauri-apps/api : 2.1.1
- @tauri-apps/cli : 2.1.0
[-] Plugins
- tauri-plugin-shell 🦀: 2.2.0
- @tauri-apps/plugin-shell : 2.2.0
- tauri-plugin-fs 🦀: 2.2.0
- @tauri-apps/plugin-fs : 2.2.0
- tauri-plugin-dialog 🦀: 2.2.0
- @tauri-apps/plugin-dialog : 2.2.0
[-] App
- build-type: bundle
- CSP: default-src 'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost; media-src 'self' asset: http://asset.localhost
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: Vue.js
- bundler: Vite
Stack trace
none
Additional context
"dependencies": {
"@huggingface/transformers": "^3.1.2",
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-dialog": "~2",
"@tauri-apps/plugin-fs": "~2",
"@tauri-apps/plugin-opener": "^1.0.0",
"@tauri-apps/plugin-shell": "^2",
"axios": "^1.7.7",
"tauri-plugin-serialplugin": "^2.4.11",
"vue": "^3.3.4",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@tauri-apps/cli": "^2",
"@vitejs/plugin-vue": "^5.0.5",
"sass": "^1.81.0",
"typescript": "^5.2.2",
"vite": "^5.3.1",
"vue-tsc": "^2.0.22"
}
I have done some research, my intuition says that it has to do something with webview/WRY, windows doesn't have this issue as far as I know.
When I disable/comment out the component that uses the transfomers pipeline in vue, after a random amount of time it resets again but the component is activated again?
In other words, component is visible and loads the pipeline, crashes/restarts, I disable the component, I the window hot-reloads and then shows the interface without the component, it crashes/restarts again, I see the original component reloaded again. Is it then maybe something vite/hot-reload related in combination with wasm?
The complete context from the web inspector is also lost in these restarts which has me think it is wry related. I will crosspost it also there.
is there a way to get a better log of this, so I can debug better?