Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from v1_functions import *
|
| 3 |
from v2_functions import *
|
|
|
|
|
|
|
| 4 |
|
| 5 |
with gr.Blocks(title="Engage Quotation Chatbot") as demo:
|
| 6 |
gr.Markdown("# Engage Quotation Chatbot")
|
|
@@ -64,6 +66,7 @@ with gr.Blocks(title="Engage Quotation Chatbot") as demo:
|
|
| 64 |
generate_btn = gr.Button("1. Generate Quotation")
|
| 65 |
analyse_quotation_btn = gr.Button("2. Analyse Quotation")
|
| 66 |
save_csv_btn = gr.Button("3. Export All")
|
|
|
|
| 67 |
units_output = gr.Textbox(label="Cost Summary", lines=3, interactive=False)
|
| 68 |
progress_update = gr.Textbox(label="Progress Update", lines=2, interactive=False)
|
| 69 |
recalc_btn = gr.Button("Recalculate")
|
|
@@ -81,6 +84,11 @@ with gr.Blocks(title="Engage Quotation Chatbot") as demo:
|
|
| 81 |
outputs=[quantity_table,progress_update, units_output]
|
| 82 |
)
|
| 83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
save_csv_btn.click(
|
| 85 |
fn=v1_save_csv,
|
| 86 |
inputs=[prd_box,tasks_table,quantity_table,merged_table,units_output],
|
|
@@ -131,6 +139,7 @@ with gr.Blocks(title="Engage Quotation Chatbot") as demo:
|
|
| 131 |
engage_generate_quotation_btn = gr.Button("3. Generate Final Quotation") # New button
|
| 132 |
engage_analyse_quotation_btn = gr.Button("4. Analyse Quotation") # New button
|
| 133 |
engage_save_all_btn = gr.Button("5. Save All Output") # New Save CSV button
|
|
|
|
| 134 |
|
| 135 |
engage_units_output = gr.Textbox(label="Cost Summary", lines=3, interactive=False)
|
| 136 |
engage_progress_update = gr.Textbox(label="Progress Update", lines=2, interactive=False)
|
|
@@ -176,6 +185,13 @@ with gr.Blocks(title="Engage Quotation Chatbot") as demo:
|
|
| 176 |
outputs=engage_progress_update # You can adjust the output as needed
|
| 177 |
)
|
| 178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
# Replace single textbox with separate components
|
| 180 |
with gr.Tab(label= "Load Project"):
|
| 181 |
gr.Markdown("### Past submissions")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from v1_functions import *
|
| 3 |
from v2_functions import *
|
| 4 |
+
from google_drive import *
|
| 5 |
+
|
| 6 |
|
| 7 |
with gr.Blocks(title="Engage Quotation Chatbot") as demo:
|
| 8 |
gr.Markdown("# Engage Quotation Chatbot")
|
|
|
|
| 66 |
generate_btn = gr.Button("1. Generate Quotation")
|
| 67 |
analyse_quotation_btn = gr.Button("2. Analyse Quotation")
|
| 68 |
save_csv_btn = gr.Button("3. Export All")
|
| 69 |
+
upload_btn = gr.Button("4. Upload to Google Drive")
|
| 70 |
units_output = gr.Textbox(label="Cost Summary", lines=3, interactive=False)
|
| 71 |
progress_update = gr.Textbox(label="Progress Update", lines=2, interactive=False)
|
| 72 |
recalc_btn = gr.Button("Recalculate")
|
|
|
|
| 84 |
outputs=[quantity_table,progress_update, units_output]
|
| 85 |
)
|
| 86 |
|
| 87 |
+
upload_btn.click(
|
| 88 |
+
fn=v1_upload_to_gdrive,
|
| 89 |
+
inputs=[prd_box,tasks_table,quantity_table,merged_table,units_output,analysis_box],
|
| 90 |
+
outputs=progress_update
|
| 91 |
+
)
|
| 92 |
save_csv_btn.click(
|
| 93 |
fn=v1_save_csv,
|
| 94 |
inputs=[prd_box,tasks_table,quantity_table,merged_table,units_output],
|
|
|
|
| 139 |
engage_generate_quotation_btn = gr.Button("3. Generate Final Quotation") # New button
|
| 140 |
engage_analyse_quotation_btn = gr.Button("4. Analyse Quotation") # New button
|
| 141 |
engage_save_all_btn = gr.Button("5. Save All Output") # New Save CSV button
|
| 142 |
+
engage_upload_btn = gr.Button("6. Upload to Google Drive") # New Save CSV button
|
| 143 |
|
| 144 |
engage_units_output = gr.Textbox(label="Cost Summary", lines=3, interactive=False)
|
| 145 |
engage_progress_update = gr.Textbox(label="Progress Update", lines=2, interactive=False)
|
|
|
|
| 185 |
outputs=engage_progress_update # You can adjust the output as needed
|
| 186 |
)
|
| 187 |
|
| 188 |
+
engage_upload_btn.click(
|
| 189 |
+
fn=v2_upload_to_gdrive,
|
| 190 |
+
inputs=[engage_prd_box_v2, engage_component_table_v2, engage_task_table_v2, engage_task_unit_table_v2, engage_quantity_table_v2, engage_analysis_box, engage_units_output],
|
| 191 |
+
outputs=engage_progress_update # You can adjust the output as needed
|
| 192 |
+
)
|
| 193 |
+
|
| 194 |
+
|
| 195 |
# Replace single textbox with separate components
|
| 196 |
with gr.Tab(label= "Load Project"):
|
| 197 |
gr.Markdown("### Past submissions")
|