Luigi commited on
Commit
26a8350
·
1 Parent(s): 9b2e057

fix: add file upload validation

Browse files

Add 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.

Files changed (1) hide show
  1. app.py +4 -0
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