reach-vb HF staff commited on
Commit
2eb733b
1 Parent(s): 495c693

Update app.py

Browse files

`pipeline` accepts a device number instead of `torch.device("cuda")`
Forcing the pipeline to work on `device=0`

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -7,7 +7,7 @@ from huggingface_hub import model_info
7
 
8
  MODEL_NAME = "openai/whisper-small" #this always needs to stay in line 8 :D sorry for the hackiness
9
 
10
- device = "cuda" if torch.cuda.is_available() else "cpu"
11
 
12
  pipe = pipeline(
13
  task="automatic-speech-recognition",
 
7
 
8
  MODEL_NAME = "openai/whisper-small" #this always needs to stay in line 8 :D sorry for the hackiness
9
 
10
+ device = 0 if torch.cuda.is_available() else "cpu"
11
 
12
  pipe = pipeline(
13
  task="automatic-speech-recognition",