Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -81,6 +81,7 @@ def clear_all_images():
|
|
81 |
def create_zip(files):
|
82 |
timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
|
83 |
zip_filename = f"images_{timestamp}.zip"
|
|
|
84 |
with zipfile.ZipFile(zip_filename, 'w') as zipf:
|
85 |
for file in files:
|
86 |
zipf.write(file, os.path.basename(file))
|
@@ -92,9 +93,9 @@ def save_all_images(images):
|
|
92 |
if len(images) == 0:
|
93 |
return None, None
|
94 |
zip_filename = create_zip(images) # Create a zip file from the list of image files
|
95 |
-
print(zip_filename)
|
96 |
|
97 |
-
gr.Button(link="/file=" + zip_filename)
|
98 |
|
99 |
# remove?
|
100 |
zip_base64 = encode_file_to_base64(zip_filename) # Encode the zip file to base64
|
|
|
81 |
def create_zip(files):
|
82 |
timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
|
83 |
zip_filename = f"images_{timestamp}.zip"
|
84 |
+
print('Creating file ' + zip_filename)
|
85 |
with zipfile.ZipFile(zip_filename, 'w') as zipf:
|
86 |
for file in files:
|
87 |
zipf.write(file, os.path.basename(file))
|
|
|
93 |
if len(images) == 0:
|
94 |
return None, None
|
95 |
zip_filename = create_zip(images) # Create a zip file from the list of image files
|
96 |
+
print(' Zip file created:' + zip_filename)
|
97 |
|
98 |
+
# gr.Button(link="/file=" + zip_filename)
|
99 |
|
100 |
# remove?
|
101 |
zip_base64 = encode_file_to_base64(zip_filename) # Encode the zip file to base64
|