pritamdeka commited on
Commit
d69306e
·
verified ·
1 Parent(s): ec4c5f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  import whisper
3
  from transformers import pipeline
4
  import librosa
 
5
 
6
  # Load Whisper model
7
  whisper_model = whisper.load_model("base")
@@ -19,9 +20,12 @@ def get_summarizer(model_name):
19
 
20
  # Function to transcribe audio file using Whisper
21
  def transcribe_audio(model_size, audio_path):
22
- if audio_path is None:
23
- return "No audio file provided."
24
-
 
 
 
25
  # Load the selected Whisper model
26
  model = whisper.load_model(model_size)
27
 
 
2
  import whisper
3
  from transformers import pipeline
4
  import librosa
5
+ import os
6
 
7
  # Load Whisper model
8
  whisper_model = whisper.load_model("base")
 
20
 
21
  # Function to transcribe audio file using Whisper
22
  def transcribe_audio(model_size, audio_path):
23
+ # Debug: Check if the file path is correctly passed
24
+ print(f"Audio file path received: {audio_path}")
25
+
26
+ if audio_path is None or not os.path.exists(audio_path):
27
+ return "No audio file provided or file path invalid."
28
+
29
  # Load the selected Whisper model
30
  model = whisper.load_model(model_size)
31