ZennyKenny commited on
Commit
55f93e7
·
verified ·
1 Parent(s): 5f36451
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,11 +5,11 @@ from transformers import pipeline
5
  @spaces.GPU(duration=60)
6
 
7
  # Check if GPU is available; fallback to CPU if not
8
- device = 0 if torch.cuda.is_available() else -1
9
 
10
  try:
11
  # Load models with error handling
12
- transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=device)
13
  summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
14
  except Exception as e:
15
  print(f"Error loading models: {e}")
 
5
  @spaces.GPU(duration=60)
6
 
7
  # Check if GPU is available; fallback to CPU if not
8
+ # device = 0 if torch.cuda.is_available() else -1
9
 
10
  try:
11
  # Load models with error handling
12
+ transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=cuda)
13
  summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
14
  except Exception as e:
15
  print(f"Error loading models: {e}")