gopichandra commited on
Commit
6685602
Β·
verified Β·
1 Parent(s): e100dbd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -17
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
- with gr.Blocks() as demo:
328
- with gr.Tab("πŸ“Š SALESFORCE DATA EXPORT"):
329
- gr.Markdown("## πŸ“Š Salesforce Data Export")
330
- generate_button = gr.Button("Generate")
331
- table_output = gr.HTML()
332
- graph_output = gr.Image(type="pil")
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)