Spaces:
Running
Running
jhj0517
commited on
Commit
·
36a1080
1
Parent(s):
ad742b8
fix bug
Browse files
modules/whisper/whisper_base.py
CHANGED
@@ -399,15 +399,15 @@ class WhisperBase(ABC):
|
|
399 |
|
400 |
return time_str.strip()
|
401 |
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
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)
|