harp-dev commited on
Commit
2fd6f6c
·
verified ·
1 Parent(s): 1f201e1

Select the device rather than hard-coding CUDA

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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)