Commit ·
11ef3eb
1
Parent(s): a7abff6
Update Naming
Browse files
app.py
CHANGED
|
@@ -3,7 +3,6 @@ import gradio as gr
|
|
| 3 |
import zipfile
|
| 4 |
import io
|
| 5 |
import os
|
| 6 |
-
import tempfile
|
| 7 |
from datetime import datetime
|
| 8 |
|
| 9 |
# Helper function to find color areas
|
|
@@ -147,13 +146,14 @@ def process_pdf_files(input_pdfs, selected_color_comment_indices, tolerance, cus
|
|
| 147 |
output_dir = "./output"
|
| 148 |
os.makedirs(output_dir, exist_ok=True)
|
| 149 |
|
| 150 |
-
#
|
| 151 |
-
|
|
|
|
| 152 |
with open(temp_filename, 'wb') as tmp_file:
|
| 153 |
tmp_file.write(zip_in_memory.read())
|
| 154 |
|
| 155 |
# Return the downloadable file path as a link
|
| 156 |
-
return f'<a href="{temp_filename}" download>Click here to download the ZIP file</a>'
|
| 157 |
|
| 158 |
# Define the Gradio interface
|
| 159 |
interface = gr.Interface(
|
|
|
|
| 3 |
import zipfile
|
| 4 |
import io
|
| 5 |
import os
|
|
|
|
| 6 |
from datetime import datetime
|
| 7 |
|
| 8 |
# Helper function to find color areas
|
|
|
|
| 146 |
output_dir = "./output"
|
| 147 |
os.makedirs(output_dir, exist_ok=True)
|
| 148 |
|
| 149 |
+
# Ensure the file is saved with the correct name
|
| 150 |
+
zip_filename = f"CoordinationPDFS_{current_date}.zip"
|
| 151 |
+
temp_filename = os.path.join(output_dir, zip_filename)
|
| 152 |
with open(temp_filename, 'wb') as tmp_file:
|
| 153 |
tmp_file.write(zip_in_memory.read())
|
| 154 |
|
| 155 |
# Return the downloadable file path as a link
|
| 156 |
+
return f'<a href="{temp_filename}" download>Click here to download the ZIP file: {zip_filename}</a>'
|
| 157 |
|
| 158 |
# Define the Gradio interface
|
| 159 |
interface = gr.Interface(
|