liuyang commited on
Commit
c088b23
·
1 Parent(s): c18172e
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -1509,9 +1509,15 @@ with demo:
1509
  - Languages: Supports 100+ languages with auto-detection
1510
  - Vocabulary: Add names and technical terms in the prompt for better accuracy
1511
  """)
1512
-
1513
- # Preload all whisper models on startup
1514
- demo.load(fn=preload_all_whisper_models, inputs=None, outputs=None)
 
 
 
 
 
 
1515
 
1516
  if __name__ == "__main__":
1517
  demo.launch(debug=True)
 
1509
  - Languages: Supports 100+ languages with auto-detection
1510
  - Vocabulary: Add names and technical terms in the prompt for better accuracy
1511
  """)
1512
+
1513
+ # Preload all whisper models once at service initialization
1514
+ print("Preloading all WhisperX transcribe models at startup...")
1515
+ try:
1516
+ preload_all_whisper_models()
1517
+ print("All WhisperX transcribe models preloaded at startup!")
1518
+ except Exception as e:
1519
+ print(f"Warning: Could not preload whisper models at startup: {e}")
1520
+ print("Models will be loaded on first use instead.")
1521
 
1522
  if __name__ == "__main__":
1523
  demo.launch(debug=True)