Spaces:
Sleeping
Sleeping
first commit
Browse files
app.py
CHANGED
|
@@ -198,24 +198,33 @@ Please be patient β takes about 20β30 minutes to process.
|
|
| 198 |
ui_logs.append("β
Pipeline completed successfully!")
|
| 199 |
ui_logs.append("="*70)
|
| 200 |
|
| 201 |
-
#
|
| 202 |
zip_file = None
|
| 203 |
|
| 204 |
-
ui_logs.append("\n
|
| 205 |
|
| 206 |
if results_path.exists():
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
ui_logs.append(f"π₯ Ready for download!")
|
| 215 |
ui_logs.append(f"\nπ Full logs saved to: {log_file_path}")
|
| 216 |
yield "\n".join(ui_logs), zip_file, ""
|
| 217 |
-
|
| 218 |
-
ui_logs.append("β οΈ
|
| 219 |
yield "\n".join(ui_logs), None, ""
|
| 220 |
else:
|
| 221 |
ui_logs.append(f"β οΈ Results folder not found at: {results_path}")
|
|
|
|
| 198 |
ui_logs.append("β
Pipeline completed successfully!")
|
| 199 |
ui_logs.append("="*70)
|
| 200 |
|
| 201 |
+
# Create zip file from Results folder
|
| 202 |
zip_file = None
|
| 203 |
|
| 204 |
+
ui_logs.append("\nπ¦ Creating zip archive from Results folder...")
|
| 205 |
|
| 206 |
if results_path.exists():
|
| 207 |
+
import shutil
|
| 208 |
+
|
| 209 |
+
# Create zip file with timestamp
|
| 210 |
+
zip_base_name = f"Results_{timestamp}"
|
| 211 |
+
zip_file_path = ROOT / zip_base_name
|
| 212 |
+
|
| 213 |
+
try:
|
| 214 |
+
# Create zip archive of the entire Results folder
|
| 215 |
+
shutil.make_archive(
|
| 216 |
+
str(zip_file_path),
|
| 217 |
+
'zip',
|
| 218 |
+
ROOT,
|
| 219 |
+
'Results'
|
| 220 |
+
)
|
| 221 |
+
zip_file = str(zip_file_path) + ".zip"
|
| 222 |
+
ui_logs.append(f"β
Created zip file: {zip_file}")
|
| 223 |
ui_logs.append(f"π₯ Ready for download!")
|
| 224 |
ui_logs.append(f"\nπ Full logs saved to: {log_file_path}")
|
| 225 |
yield "\n".join(ui_logs), zip_file, ""
|
| 226 |
+
except Exception as e:
|
| 227 |
+
ui_logs.append(f"β οΈ Failed to create zip file: {str(e)}")
|
| 228 |
yield "\n".join(ui_logs), None, ""
|
| 229 |
else:
|
| 230 |
ui_logs.append(f"β οΈ Results folder not found at: {results_path}")
|