Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,8 @@ def format_timestamp(seconds):
|
|
15 |
|
16 |
def transcribe(audio_file, model_size):
|
17 |
# Initialize the Whisper model based on the selected model size
|
18 |
-
device = "
|
19 |
-
compute_type = "
|
20 |
|
21 |
model = WhisperModel(model_size, device=device, compute_type=compute_type)
|
22 |
|
|
|
15 |
|
16 |
def transcribe(audio_file, model_size):
|
17 |
# Initialize the Whisper model based on the selected model size
|
18 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
19 |
+
compute_type = "float16" if device == "cuda" else "int8"
|
20 |
|
21 |
model = WhisperModel(model_size, device=device, compute_type=compute_type)
|
22 |
|