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:
@@ -319,16 +319,25 @@
|
||||
whisperStatusEl.textContent = `⬇️ Downloading ${progress.model}: ${percent}% (${downloadedMb}/${totalMb} MB)`;
|
||||
whisperStatusEl.style.color = '#ff9800';
|
||||
} else if (progress.status === 'model_downloaded') {
|
||||
whisperStatusEl.textContent = `✅ ${progress.model} downloaded`;
|
||||
whisperStatusEl.textContent = `✅ ${progress.model} downloaded, loading...`;
|
||||
whisperStatusEl.style.color = '#28a745';
|
||||
} else if (progress.status === 'model_cached') {
|
||||
whisperStatusEl.textContent = `✅ ${progress.model} cached, loading...`;
|
||||
whisperStatusEl.style.color = '#28a745';
|
||||
} else if (progress.status === 'incomplete_cache') {
|
||||
whisperStatusEl.textContent = `⚠️ ${progress.model} cache incomplete, re-downloading...`;
|
||||
whisperStatusEl.style.color = '#ff9800';
|
||||
} else if (progress.status === 'loading_model') {
|
||||
whisperStatusEl.textContent = `⏳ Loading ${progress.model}...`;
|
||||
whisperStatusEl.style.color = '#ffc107';
|
||||
} else if (progress.status === 'model_loaded') {
|
||||
whisperStatusEl.textContent = `✅ Ready`;
|
||||
whisperStatusEl.textContent = `✅ Model ready`;
|
||||
whisperStatusEl.style.color = '#28a745';
|
||||
// Trigger a status refresh
|
||||
updateWhisperStatus();
|
||||
} else if (progress.status === 'model_error') {
|
||||
whisperStatusEl.textContent = `❌ Error: ${progress.error || 'Model load failed'}`;
|
||||
whisperStatusEl.style.color = '#dc3545';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user