paragon-analytics commited on
Commit
7de9116
·
1 Parent(s): 4a73816

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -92,11 +92,17 @@ def adr_predict(x):
92
 
93
  shap_values = explainer([str(x).lower()])
94
  plot = shap.plots.text(shap_values[0], display=False)
 
 
 
 
 
 
95
 
96
- plt.tight_layout()
97
- local_plot = plt.gcf()
98
- plt.rcParams['figure.figsize'] = 6,4
99
- plt.close()
100
 
101
 
102
 
@@ -132,7 +138,8 @@ with gr.Blocks(title=title) as demo:
132
  # "-": "blue", "NA":"white"})
133
 
134
  # interpretation = gr.components.Interpretation(prob1)
135
- local_plot = gr.Plot(label = 'Shap:')
 
136
 
137
 
138
  submit_btn.click(
 
92
 
93
  shap_values = explainer([str(x).lower()])
94
  plot = shap.plots.text(shap_values[0], display=False)
95
+
96
+ local_plot = (
97
+ ""
98
+ + plot
99
+ + ""
100
+ )
101
 
102
+ # plt.tight_layout()
103
+ # local_plot = plt.gcf()
104
+ # plt.rcParams['figure.figsize'] = 6,4
105
+ # plt.close()
106
 
107
 
108
 
 
138
  # "-": "blue", "NA":"white"})
139
 
140
  # interpretation = gr.components.Interpretation(prob1)
141
+ local_plot = gr.HTML(label = 'Shap:')
142
+ # local_plot = gr.Plot(label = 'Shap:')
143
 
144
 
145
  submit_btn.click(