Wajahat698 commited on
Commit
a992ab7
·
verified ·
1 Parent(s): 91a375f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -20
app.py CHANGED
@@ -1248,14 +1248,21 @@ def process_examples(file_name):
1248
  file_path = f"example_files/{file_name[0]}"
1249
  file_path = [file_path]
1250
  outputs = variable_outputs(file_path)
1251
- trust_score_output_1 = gr.Image(label="Trust Score 1", type="pil")
1252
-
1253
- trust_score_output_1(display_trust_score_1)
1254
 
1255
 
1256
 
1257
- return outputs
1258
-
 
 
 
 
 
 
 
 
 
1259
 
1260
 
1261
 
@@ -1774,31 +1781,19 @@ with gr.Blocks() as demo:
1774
  )
1775
 
1776
  ## All widget functions here ##
1777
- vw_customers_btn.click(
1778
- fn=display_trust_score_1,
1779
- inputs=[],
1780
- outputs=trust_score_output,
1781
-
1782
- )
1783
- vw_prospects_btn.click(
1784
- fn=display_trust_score_2,
1785
- inputs=[],
1786
- outputs=trust_score_output,
1787
 
1788
- )
1789
-
1790
  vw_customers_btn.click(
1791
  fn=process_examples,
1792
  inputs=[vw_customers_state],
1793
- outputs=outputs,
1794
 
1795
  )
1796
 
1797
 
1798
  vw_prospects_btn.click(
1799
- fn=process_examples,
1800
  inputs=[vw_prospects_state],
1801
- outputs=outputs,
1802
  )
1803
 
1804
 
 
1248
  file_path = f"example_files/{file_name[0]}"
1249
  file_path = [file_path]
1250
  outputs = variable_outputs(file_path)
1251
+ img = display_trust_score_1()
 
 
1252
 
1253
 
1254
 
1255
+ return outputs,img
1256
+
1257
+ def process_examples1(file_name):
1258
+ file_path = f"example_files/{file_name[0]}"
1259
+ file_path = [file_path]
1260
+ outputs = variable_outputs(file_path)
1261
+ img = display_trust_score_2()
1262
+
1263
+
1264
+
1265
+ return outputs,img
1266
 
1267
 
1268
 
 
1781
  )
1782
 
1783
  ## All widget functions here ##
 
 
 
 
 
 
 
 
 
 
1784
 
 
 
1785
  vw_customers_btn.click(
1786
  fn=process_examples,
1787
  inputs=[vw_customers_state],
1788
+ outputs=[outputs,trust_score_output],
1789
 
1790
  )
1791
 
1792
 
1793
  vw_prospects_btn.click(
1794
+ fn=process_examples1,
1795
  inputs=[vw_prospects_state],
1796
+ outputs=[outputs,trust_score_output],
1797
  )
1798
 
1799