Spaces:
Runtime error
Runtime error
Update app.py
Browse filesfixing runtime error
app.py
CHANGED
@@ -7,7 +7,7 @@ model = whisper.load_model("base")
|
|
7 |
def transcribe_audio(audio_file):
|
8 |
# Check file size (e.g., 25MB limit)
|
9 |
if os.path.getsize(audio_file.name) > 25 * 1024 * 1024:
|
10 |
-
|
11 |
|
12 |
result = model.transcribe(audio_file.name)
|
13 |
output_filename = os.path.splitext(os.path.basename(audio_file.name))[0] + ".txt"
|
|
|
7 |
def transcribe_audio(audio_file):
|
8 |
# Check file size (e.g., 25MB limit)
|
9 |
if os.path.getsize(audio_file.name) > 25 * 1024 * 1024:
|
10 |
+
return "Error: File size exceeds 25MB limit.", None
|
11 |
|
12 |
result = model.transcribe(audio_file.name)
|
13 |
output_filename = os.path.splitext(os.path.basename(audio_file.name))[0] + ".txt"
|