File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,14 +235,24 @@ def load_model_in_background(self):
235235 def load_model ():
236236 try :
237237 self .status .set ("Loading whisper model (this may take a while)..." )
238- self .model = whisper .load_model (self .model_size .get ())
238+
239+ # Create a cache directory in user's appdata
240+ cache_dir = os .path .join (os .getenv ('LOCALAPPDATA' ), 'WhisperCache' )
241+ os .makedirs (cache_dir , exist_ok = True )
242+
243+ # Load model with explicit cache directory
244+ self .model = whisper .load_model (
245+ self .model_size .get (),
246+ download_root = cache_dir
247+ )
248+
239249 self .model_loaded = True
240250 self .status .set ("Ready to transcribe" )
241251 self .transcribe_btn .config (state = tk .NORMAL )
242252 except Exception as e :
243253 self .status .set (f"Error loading model: { str (e )} " )
244254 messagebox .showerror ("Error" , f"Failed to load model: { str (e )} " )
245-
255+
246256 threading .Thread (target = load_model , daemon = True ).start ()
247257
248258 def select_input_file (self ):
You can’t perform that action at this time.
0 commit comments