diff --git a/whisper_local/__main__.py b/whisper_local/__main__.py index f45a938..5d489c5 100644 --- a/whisper_local/__main__.py +++ b/whisper_local/__main__.py @@ -30,10 +30,22 @@ class App: min_duration=config.min_duration, device=config.microphone or None, ) + if sys.platform == "win32": + from whisper_local.tray._download_progress import load_model_with_progress + from whisper_local.transcriber import _model_cache_dir + _preloaded_model = load_model_with_progress( + model_name=config.whisper_model, + compute_type=config.compute_type, + download_root=_model_cache_dir(), + ) + else: + _preloaded_model = None + self.transcriber = Transcriber( model_name=config.whisper_model, compute_type=config.compute_type, language=config.language, + model=_preloaded_model, ) self.inserter = create_inserter() self.hotkey = create_listener(key_name=config.hotkey)