Update app.py
Browse files
app.py
CHANGED
|
@@ -101,8 +101,12 @@ def extract_audio(file_path):
|
|
| 101 |
return audio_path
|
| 102 |
|
| 103 |
def transcribe_audio(audio_path):
|
| 104 |
-
"""Transcribes audio to text using Whisper."""
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
result = model.transcribe(audio_path)
|
| 107 |
return result['text']
|
| 108 |
|
|
|
|
| 101 |
return audio_path
|
| 102 |
|
| 103 |
def transcribe_audio(audio_path):
|
| 104 |
+
"""Transcribes audio to text using Whisper with model download handling."""
|
| 105 |
+
try:
|
| 106 |
+
model = whisper.load_model("base")
|
| 107 |
+
except Exception:
|
| 108 |
+
st.warning("Downloading Whisper model. This may take a while...")
|
| 109 |
+
model = whisper.load_model("base")
|
| 110 |
result = model.transcribe(audio_path)
|
| 111 |
return result['text']
|
| 112 |
|