TaahKay commited on
Commit
12cbf91
·
verified ·
1 Parent(s): b730854

Update models/model_loader.py

Browse files
Files changed (1) hide show
  1. models/model_loader.py +2 -0
models/model_loader.py CHANGED
@@ -5,6 +5,7 @@ CACHE_DIR = "/tmp/pretrained_models"
5
 
6
  import torch
7
  import gc
 
8
 
9
  from speechbrain.pretrained.interfaces import foreign_class
10
  from faster_whisper import WhisperModel
@@ -41,3 +42,4 @@ def unload_model(model):
41
  del model
42
  torch.cuda.empty_cache()
43
  gc.collect()
 
 
5
 
6
  import torch
7
  import gc
8
+ import time
9
 
10
  from speechbrain.pretrained.interfaces import foreign_class
11
  from faster_whisper import WhisperModel
 
42
  del model
43
  torch.cuda.empty_cache()
44
  gc.collect()
45
+ time.sleep(10) # give system time to clean up before moving on