Spaces:
Running
Running
fix: add file upload validation
Browse filesAdd check for None file_obj at start of file reading to show user-friendly
error message instead of Python TypeError when no file is uploaded.
app.py
CHANGED
|
@@ -765,6 +765,10 @@ def summarize_streaming(
|
|
| 765 |
|
| 766 |
# Read uploaded file
|
| 767 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 768 |
path = file_obj.name if hasattr(file_obj, 'name') else file_obj
|
| 769 |
# Get file metadata
|
| 770 |
import os
|
|
|
|
| 765 |
|
| 766 |
# Read uploaded file
|
| 767 |
try:
|
| 768 |
+
if file_obj is None:
|
| 769 |
+
yield ("", "Error: Please upload a transcript file first", "", metrics)
|
| 770 |
+
return
|
| 771 |
+
|
| 772 |
path = file_obj.name if hasattr(file_obj, 'name') else file_obj
|
| 773 |
# Get file metadata
|
| 774 |
import os
|