jhj0517 commited on
Commit
2205c35
·
1 Parent(s): 1995790

debug release function

Browse files
Files changed (1) hide show
  1. modules/whisper/whisper_base.py +2 -1
modules/whisper/whisper_base.py CHANGED
@@ -404,8 +404,9 @@ class WhisperBase(ABC):
404
 
405
  return time_str.strip()
406
 
 
407
  def release_cuda_memory(self):
408
- if self.device == "cuda":
409
  torch.cuda.empty_cache()
410
  torch.cuda.reset_max_memory_allocated()
411
 
 
404
 
405
  return time_str.strip()
406
 
407
+ @spaces.GPU(duration=120)
408
  def release_cuda_memory(self):
409
+ if torch.cuda.is_available():
410
  torch.cuda.empty_cache()
411
  torch.cuda.reset_max_memory_allocated()
412