legusxyz commited on
Commit
44edf06
·
verified ·
1 Parent(s): 35963ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -9,8 +9,7 @@ import time
9
  app = FastAPI()
10
 
11
  # Load the Whisper model once during startup
12
- # device = 0 if torch.cuda.is_available() else -1 # Use GPU if available, otherwise CPU
13
- device = -1
14
  asr_pipeline = pipeline(model="openai/whisper-tiny", device=device) # Initialize Whisper model
15
 
16
  # Basic GET endpoint
 
9
  app = FastAPI()
10
 
11
  # Load the Whisper model once during startup
12
+ device = 0 if torch.cuda.is_available() else -1 # Use GPU if available, otherwise CPU
 
13
  asr_pipeline = pipeline(model="openai/whisper-tiny", device=device) # Initialize Whisper model
14
 
15
  # Basic GET endpoint