jhj0517 commited on
Commit
36a1080
·
1 Parent(s): ad742b8
Files changed (1) hide show
  1. modules/whisper/whisper_base.py +9 -9
modules/whisper/whisper_base.py CHANGED
@@ -399,15 +399,15 @@ class WhisperBase(ABC):
399
 
400
  return time_str.strip()
401
 
402
- # @staticmethod
403
- # @spaces.GPU(duration=120)
404
- # def get_device():
405
- # if torch.cuda.is_available():
406
- # return "cuda"
407
- # elif torch.backends.mps.is_available():
408
- # return "mps"
409
- # else:
410
- # return "cpu"
411
 
412
  @staticmethod
413
  @spaces.GPU(duration=120)
 
399
 
400
  return time_str.strip()
401
 
402
+ @staticmethod
403
+ @spaces.GPU(duration=120)
404
+ def get_device():
405
+ if torch.cuda.is_available():
406
+ return "cuda"
407
+ elif torch.backends.mps.is_available():
408
+ return "mps"
409
+ else:
410
+ return "cpu"
411
 
412
  @staticmethod
413
  @spaces.GPU(duration=120)