Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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"
|
@@ -26,4 +26,6 @@ iface = gr.Interface(
|
|
26 |
],
|
27 |
title="Free Transcript Maker",
|
28 |
description="Upload an audio file (WAV, MP3, etc.) up to 25MB to get its transcription. The transcript will be displayed and available for download. Please use responsibly."
|
29 |
-
)
|
|
|
|
|
|
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.", ""
|
11 |
|
12 |
result = model.transcribe(audio_file.name)
|
13 |
output_filename = os.path.splitext(os.path.basename(audio_file.name))[0] + ".txt"
|
|
|
26 |
],
|
27 |
title="Free Transcript Maker",
|
28 |
description="Upload an audio file (WAV, MP3, etc.) up to 25MB to get its transcription. The transcript will be displayed and available for download. Please use responsibly."
|
29 |
+
)
|
30 |
+
|
31 |
+
iface.launch(share=True)
|