ajayarora1235 commited on
Commit
8fd9be6
·
1 Parent(s): 9307dcc

fix whisper issue

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1427,8 +1427,9 @@ def stoptraining(mim):
1427
  def transcribe_btn_click(audio_choice):
1428
  batch_size = 1 # Adjust based on your GPU memory availability
1429
  compute_type = "float16"
 
1430
 
1431
- model = whisperx.load_model("large-v2", config.device, compute_type=compute_type)
1432
  pre_result = model.transcribe(audio_choice, batch_size=batch_size)
1433
 
1434
  # Correctly handle the transcription result based on its structure
 
1427
  def transcribe_btn_click(audio_choice):
1428
  batch_size = 1 # Adjust based on your GPU memory availability
1429
  compute_type = "float16"
1430
+ device = "cuda" if torch.cuda.is_available() else "cpu"
1431
 
1432
+ model = whisperx.load_model("large-v2", device, compute_type=compute_type)
1433
  pre_result = model.transcribe(audio_choice, batch_size=batch_size)
1434
 
1435
  # Correctly handle the transcription result based on its structure