Update app.py
Browse files
app.py
CHANGED
|
@@ -280,14 +280,6 @@ def process_image(image, mode, entry_type, quantity):
|
|
| 280 |
attributes = extract_attributes(extracted_text)
|
| 281 |
if product_name:
|
| 282 |
attributes["Product name"] = product_name
|
| 283 |
-
|
| 284 |
-
def generate_data():
|
| 285 |
-
df = format_salesforce_data()
|
| 286 |
-
if df is not None:
|
| 287 |
-
table_component = df.to_html(index=False)
|
| 288 |
-
graph_component = generate_bar_graph(df)
|
| 289 |
-
return table_component, graph_component
|
| 290 |
-
return "No Data Available", None
|
| 291 |
|
| 292 |
# Interact with Salesforce
|
| 293 |
message = interact_with_salesforce(mode, entry_type, quantity, extracted_text)
|
|
@@ -324,16 +316,14 @@ def app():
|
|
| 324 |
title="π’ VENKATARAMANA MOTORS",
|
| 325 |
description="π¦ Inventory Management System"
|
| 326 |
)
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
generate_button.click(fn=generate_data, inputs=[], outputs=[table_output, graph_output])
|
| 335 |
-
|
| 336 |
return demo
|
| 337 |
|
|
|
|
| 338 |
if __name__ == "__main__":
|
| 339 |
app().launch(share=True)
|
|
|
|
| 280 |
attributes = extract_attributes(extracted_text)
|
| 281 |
if product_name:
|
| 282 |
attributes["Product name"] = product_name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
|
| 284 |
# Interact with Salesforce
|
| 285 |
message = interact_with_salesforce(mode, entry_type, quantity, extracted_text)
|
|
|
|
| 316 |
title="π’ VENKATARAMANA MOTORS",
|
| 317 |
description="π¦ Inventory Management System"
|
| 318 |
)
|
| 319 |
+
|
| 320 |
+
with gr.Tab("π SALESFORCE DATA EXPORT"):
|
| 321 |
+
gr.Markdown("## π Salesforce Data Export")
|
| 322 |
+
table_output = gr.HTML(value=table_component if table_component else "No Data Available")
|
| 323 |
+
graph_output = gr.Image(value=bar_graph_component if bar_graph_component else None, type="pil")
|
| 324 |
+
|
|
|
|
|
|
|
|
|
|
| 325 |
return demo
|
| 326 |
|
| 327 |
+
|
| 328 |
if __name__ == "__main__":
|
| 329 |
app().launch(share=True)
|