fix: Improve Whisper model status verification and PyInstaller builds

- Add robust model cache verification (check model.bin + config.json)
- Add new status messages: model_cached, incomplete_cache, model_error
- Forward model status events to frontend for better UI feedback
- Add clean_build_cache() to remove stale spec files before build
- Add --clean flag to PyInstaller commands
- Change sidecar from --onefile to --onedir for faster startup
- Add missing hidden imports: onnxruntime, wave, huggingface_hub.utils

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-17 20:33:59 +08:00
parent 012cdaf5f3
commit d75789f23e
5 changed files with 136 additions and 15 deletions

View File

@@ -423,6 +423,21 @@ function startSidecar() {
if (msg.status === "model_loaded" && mainWindow) {
mainWindow.webContents.send("model-download-progress", msg);
}
// Forward model cached status (model was already downloaded)
if (msg.status === "model_cached" && mainWindow) {
mainWindow.webContents.send("model-download-progress", msg);
}
// Forward incomplete cache status
if (msg.status === "incomplete_cache" && mainWindow) {
mainWindow.webContents.send("model-download-progress", msg);
}
// Forward model error status
if (msg.status === "model_error" && mainWindow) {
mainWindow.webContents.send("model-download-progress", msg);
}
} catch (e) {
console.log("Sidecar output:", line);
}