Spaces:
Runtime error
Runtime error
Commit
•
43d9cec
1
Parent(s):
4eab79c
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ def transcribe(microphone, file_upload, task):
|
|
36 |
elif (microphone is None) and (file_upload is None):
|
37 |
raise gr.Error("You have to either use the microphone or upload an audio file")
|
38 |
|
39 |
-
file_size_mb = os.stat(
|
40 |
if file_size_mb > FILE_LIMIT_MB:
|
41 |
raise gr.Error(
|
42 |
f"File size exceeds file size limit. Got file of size {file_size_mb:.2f}MB for a limit of {FILE_LIMIT_MB}MB."
|
|
|
36 |
elif (microphone is None) and (file_upload is None):
|
37 |
raise gr.Error("You have to either use the microphone or upload an audio file")
|
38 |
|
39 |
+
file_size_mb = os.stat(file_upload).st_size / (1024 * 1024)
|
40 |
if file_size_mb > FILE_LIMIT_MB:
|
41 |
raise gr.Error(
|
42 |
f"File size exceeds file size limit. Got file of size {file_size_mb:.2f}MB for a limit of {FILE_LIMIT_MB}MB."
|