Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1231,7 +1231,7 @@ def handle_large_dataset(df, create_document,isDataFrame):
|
|
1231 |
#Logic to generate pdfs with employee name and account number
|
1232 |
for index, row in df.iterrows():
|
1233 |
# Create a PDF for each row
|
1234 |
-
create_pdf(row['
|
1235 |
create_document = False
|
1236 |
docstatus += f" {total_rows} documents are created successfully."
|
1237 |
print(sample_table)
|
@@ -1244,18 +1244,17 @@ def handle_large_dataset(df, create_document,isDataFrame):
|
|
1244 |
|
1245 |
else:
|
1246 |
return "Your query returns a large dataset which is not supported in the current version. Please try a different query."
|
1247 |
-
def create_pdf(
|
1248 |
|
1249 |
|
1250 |
-
filled = FormWrapper("
|
1251 |
{
|
1252 |
-
"
|
1253 |
-
"
|
1254 |
-
|
1255 |
},
|
1256 |
)
|
1257 |
-
|
1258 |
-
output_file_name = f"{name}.pdf"
|
1259 |
with open(output_file_name, "wb+") as output:
|
1260 |
output.write(filled.read())
|
1261 |
|
@@ -1369,7 +1368,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
|
|
1369 |
sample_button = gr.Button("What are the details of ASN24091600002", elem_classes="gr-buttonbig")
|
1370 |
sample_button1 = gr.Button("What are the active warehouses available", elem_classes="gr-buttonbig")
|
1371 |
sample_button2 = gr.Button("Explain Pre-Receiving Yard Management", elem_classes="gr-buttonbig")
|
1372 |
-
sample_button3 = gr.Button("can you generate a
|
1373 |
sample_button4 = gr.Button("Analyze item name & quantity for different customers in a stacked bar chart for the warehouse WH1000001 & send email to [email protected]", elem_classes="gr-button")
|
1374 |
|
1375 |
# Chatbot component
|
|
|
1231 |
#Logic to generate pdfs with employee name and account number
|
1232 |
for index, row in df.iterrows():
|
1233 |
# Create a PDF for each row
|
1234 |
+
create_pdf(row['COMPANY'], row['EMPLOYEE NAME'])
|
1235 |
create_document = False
|
1236 |
docstatus += f" {total_rows} documents are created successfully."
|
1237 |
print(sample_table)
|
|
|
1244 |
|
1245 |
else:
|
1246 |
return "Your query returns a large dataset which is not supported in the current version. Please try a different query."
|
1247 |
+
def create_pdf(cname,ename):
|
1248 |
|
1249 |
|
1250 |
+
filled = FormWrapper("LOA_Sample.pdf").fill(
|
1251 |
{
|
1252 |
+
"company name": cname,
|
1253 |
+
"employee name": ename,
|
1254 |
+
|
1255 |
},
|
1256 |
)
|
1257 |
+
output_file_name = f"documents\\{ename}_{cname}.pdf"
|
|
|
1258 |
with open(output_file_name, "wb+") as output:
|
1259 |
output.write(filled.read())
|
1260 |
|
|
|
1368 |
sample_button = gr.Button("What are the details of ASN24091600002", elem_classes="gr-buttonbig")
|
1369 |
sample_button1 = gr.Button("What are the active warehouses available", elem_classes="gr-buttonbig")
|
1370 |
sample_button2 = gr.Button("Explain Pre-Receiving Yard Management", elem_classes="gr-buttonbig")
|
1371 |
+
sample_button3 = gr.Button("can you generate a doughnut chart with item name and quantities for warehouse WH1000001", elem_classes="gr-buttonbig")
|
1372 |
sample_button4 = gr.Button("Analyze item name & quantity for different customers in a stacked bar chart for the warehouse WH1000001 & send email to [email protected]", elem_classes="gr-button")
|
1373 |
|
1374 |
# Chatbot component
|