Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -88,12 +88,13 @@ def save_all_images(images):
|
|
88 |
zip_filename = create_zip(images) # Create a zip file from the list of image files
|
89 |
print(' Zip file created:' + zip_filename)
|
90 |
|
91 |
-
|
92 |
|
93 |
# remove?
|
94 |
zip_base64 = encode_file_to_base64(zip_filename) # Encode the zip file to base64
|
95 |
download_link = f'<a href="data:application/zip;base64,{zip_base64}" download="{zip_filename}">Download All</a>'
|
96 |
-
|
|
|
97 |
# redirect_button = gr.Button("Clear", variant='secondary')
|
98 |
# redirect_button.click(None, None,None, _js="window.location.assign('https://google.com');")
|
99 |
|
@@ -106,10 +107,10 @@ def save_all_button_click():
|
|
106 |
if zip_filename:
|
107 |
print(zip_filename)
|
108 |
gr.Button(link=zip_filename)
|
109 |
-
|
110 |
if download_link:
|
111 |
print(download_link)
|
112 |
-
|
113 |
gr.Button(link=download_link)
|
114 |
|
115 |
# Function to handle "Clear All" button click
|
|
|
88 |
zip_filename = create_zip(images) # Create a zip file from the list of image files
|
89 |
print(' Zip file created:' + zip_filename)
|
90 |
|
91 |
+
gr.Button(link="/file=" + zip_filename)
|
92 |
|
93 |
# remove?
|
94 |
zip_base64 = encode_file_to_base64(zip_filename) # Encode the zip file to base64
|
95 |
download_link = f'<a href="data:application/zip;base64,{zip_base64}" download="{zip_filename}">Download All</a>'
|
96 |
+
gr.HTML(download_link)
|
97 |
+
|
98 |
# redirect_button = gr.Button("Clear", variant='secondary')
|
99 |
# redirect_button.click(None, None,None, _js="window.location.assign('https://google.com');")
|
100 |
|
|
|
107 |
if zip_filename:
|
108 |
print(zip_filename)
|
109 |
gr.Button(link=zip_filename)
|
110 |
+
gr.File(value=zip_filename)
|
111 |
if download_link:
|
112 |
print(download_link)
|
113 |
+
gr.HTML(download_link)
|
114 |
gr.Button(link=download_link)
|
115 |
|
116 |
# Function to handle "Clear All" button click
|