Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1211,6 +1211,7 @@ def handle_large_dataset(df, create_document,isDataFrame):
|
|
1211 |
create_pdf(row['COMPANY'], row['EMPLOYEE NAME'], row['ACCOUNT NUMBER'],directory)
|
1212 |
create_document = False
|
1213 |
zip_name = 'output_files.zip'
|
|
|
1214 |
zip_files_in_folder(directory, zip_name)
|
1215 |
create_file_HF(zip_name,directory, False)
|
1216 |
docstatus = f"Please download the complete dataset here: <a href='https://redmindtechnologies.com/RedMindGPT/output.zip' download>Download</a>. {total_rows} documents are created successfully."
|
@@ -1267,6 +1268,9 @@ def create_pdf(cname,ename,account_number, directory):
|
|
1267 |
document_created = True
|
1268 |
with open(output_file_name, "wb+") as output:
|
1269 |
output.write(filled.read())
|
|
|
|
|
|
|
1270 |
create_file_HF(output_file_name, directory,document_created)
|
1271 |
|
1272 |
|
@@ -1274,7 +1278,8 @@ def create_pdf(cname,ename,account_number, directory):
|
|
1274 |
|
1275 |
def zip_files_in_folder(folder_path, zip_name):
|
1276 |
# Create a Zip file
|
1277 |
-
folder_path="./"
|
|
|
1278 |
with zipfile.ZipFile(zip_name, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
1279 |
# Walk through the folder
|
1280 |
for root, dirs, files in os.walk(folder_path):
|
|
|
1211 |
create_pdf(row['COMPANY'], row['EMPLOYEE NAME'], row['ACCOUNT NUMBER'],directory)
|
1212 |
create_document = False
|
1213 |
zip_name = 'output_files.zip'
|
1214 |
+
print(zip_name)
|
1215 |
zip_files_in_folder(directory, zip_name)
|
1216 |
create_file_HF(zip_name,directory, False)
|
1217 |
docstatus = f"Please download the complete dataset here: <a href='https://redmindtechnologies.com/RedMindGPT/output.zip' download>Download</a>. {total_rows} documents are created successfully."
|
|
|
1268 |
document_created = True
|
1269 |
with open(output_file_name, "wb+") as output:
|
1270 |
output.write(filled.read())
|
1271 |
+
# Get the absolute path
|
1272 |
+
file_path = os.path.abspath(output_file_name)
|
1273 |
+
print(f"The file was created at: {file_path}")
|
1274 |
create_file_HF(output_file_name, directory,document_created)
|
1275 |
|
1276 |
|
|
|
1278 |
|
1279 |
def zip_files_in_folder(folder_path, zip_name):
|
1280 |
# Create a Zip file
|
1281 |
+
#folder_path="./"
|
1282 |
+
print(folder_path)
|
1283 |
with zipfile.ZipFile(zip_name, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
1284 |
# Walk through the folder
|
1285 |
for root, dirs, files in os.walk(folder_path):
|