Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -307,6 +307,14 @@ def process_pdf(file_obj, progress=gr.Progress()) -> Tuple[Optional[str], str, s
|
|
| 307 |
for file_path in output_files:
|
| 308 |
zipf.write(file_path, file_path.name)
|
| 309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 310 |
# Generate statistics with proper styling
|
| 311 |
stats_html = f"""
|
| 312 |
<div style="padding: 20px; background: #f0f9ff; border-radius: 10px; margin: 10px 0; border: 2px solid #0284c7;">
|
|
|
|
| 307 |
for file_path in output_files:
|
| 308 |
zipf.write(file_path, file_path.name)
|
| 309 |
|
| 310 |
+
# CRITICAL: Verify the ZIP file was created
|
| 311 |
+
if not zip_path.exists():
|
| 312 |
+
raise Exception("ZIP file creation failed")
|
| 313 |
+
|
| 314 |
+
# Log for debugging
|
| 315 |
+
logger.info(f"ZIP file created at: {zip_path}")
|
| 316 |
+
logger.info(f"ZIP file size: {zip_path.stat().st_size / 1024 / 1024:.2f} MB")
|
| 317 |
+
|
| 318 |
# Generate statistics with proper styling
|
| 319 |
stats_html = f"""
|
| 320 |
<div style="padding: 20px; background: #f0f9ff; border-radius: 10px; margin: 10px 0; border: 2px solid #0284c7;">
|