Spaces:
Running on Zero
Running on Zero
Select the device rather than hard-coding CUDA
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ def load_model(device: str):
|
|
| 45 |
|
| 46 |
@spaces.GPU
|
| 47 |
def transcribe(input_file):
|
| 48 |
-
device = "cuda"
|
| 49 |
model = load_model(device)
|
| 50 |
|
| 51 |
signal = load_audio(input_file)
|
|
|
|
| 45 |
|
| 46 |
@spaces.GPU
|
| 47 |
def transcribe(input_file):
|
| 48 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 49 |
model = load_model(device)
|
| 50 |
|
| 51 |
signal = load_audio(input_file)
|