Spaces:
Running
Running
torch device
Browse files
app.py
CHANGED
|
@@ -72,7 +72,8 @@ def transcribe(youtube_url, audio_file, whisper_model, gemini_api_key, gemini_pr
|
|
| 72 |
gemini_api_key = default_gemini_api_key
|
| 73 |
model = configure_genai(gemini_api_key, gemini_model_variant)
|
| 74 |
|
| 75 |
-
device = 0 if torch.cuda.is_available() else "cpu"
|
|
|
|
| 76 |
pipe = pipeline(
|
| 77 |
task="automatic-speech-recognition",
|
| 78 |
model=whisper_model,
|
|
|
|
| 72 |
gemini_api_key = default_gemini_api_key
|
| 73 |
model = configure_genai(gemini_api_key, gemini_model_variant)
|
| 74 |
|
| 75 |
+
# device = 0 if torch.cuda.is_available() else "cpu"
|
| 76 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 77 |
pipe = pipeline(
|
| 78 |
task="automatic-speech-recognition",
|
| 79 |
model=whisper_model,
|