Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,14 +59,14 @@ def process_input(file_input, temperature, page_num):
|
|
| 59 |
image_to_process, total_pages, actual_page = process_pdf(file_path, int(page_num))
|
| 60 |
page_info = f"Processing page {actual_page} of {total_pages}"
|
| 61 |
except Exception as e:
|
| 62 |
-
yield f"Error processing PDF
|
| 63 |
return
|
| 64 |
else:
|
| 65 |
try:
|
| 66 |
image_to_process = Image.open(file_path)
|
| 67 |
page_info = "Processing image"
|
| 68 |
except Exception as e:
|
| 69 |
-
yield f"Error opening image
|
| 70 |
return
|
| 71 |
|
| 72 |
content = [
|
|
@@ -121,7 +121,7 @@ def process_input(file_input, temperature, page_num):
|
|
| 121 |
continue
|
| 122 |
|
| 123 |
except Exception as e:
|
| 124 |
-
error_msg = f"Error
|
| 125 |
yield error_msg, error_msg, page_info, image_to_process, gr.update()
|
| 126 |
|
| 127 |
|
|
|
|
| 59 |
image_to_process, total_pages, actual_page = process_pdf(file_path, int(page_num))
|
| 60 |
page_info = f"Processing page {actual_page} of {total_pages}"
|
| 61 |
except Exception as e:
|
| 62 |
+
yield f"Error processing PDF", "", "", None, gr.update()
|
| 63 |
return
|
| 64 |
else:
|
| 65 |
try:
|
| 66 |
image_to_process = Image.open(file_path)
|
| 67 |
page_info = "Processing image"
|
| 68 |
except Exception as e:
|
| 69 |
+
yield f"Error opening image", "", "", None, gr.update()
|
| 70 |
return
|
| 71 |
|
| 72 |
content = [
|
|
|
|
| 121 |
continue
|
| 122 |
|
| 123 |
except Exception as e:
|
| 124 |
+
error_msg = f"Error"
|
| 125 |
yield error_msg, error_msg, page_info, image_to_process, gr.update()
|
| 126 |
|
| 127 |
|