YchKhan commited on
Commit
f350911
1 Parent(s): 8a65d08

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -110,12 +110,12 @@ df_cate = pd.DataFrame(categories)
110
  # return gr.update(choices=list(df.columns))
111
 
112
 
113
- def reset_cate(df_category):
114
- if df_category.equals(df_cate):
115
- df_category = pd.DataFrame(columns=['topic', 'description', 'expert'])
116
  else:
117
- df_category = df_cate.copy()
118
- return df_category
119
 
120
 
121
  global value
@@ -270,7 +270,7 @@ with gr.Blocks() as demo:
270
 
271
  #classification
272
  btn_classif.click(classification, inputs=[dd_source_class, fi_excel, df_category, sl_treshold], outputs=[fi_excel, df_output])
273
- btn_reset_df.click(reset_cate, inputs=df_cate, outputs=df_cate)
274
 
275
  #charts
276
  btn_chart.click(create_bar_plot, inputs=[fi_excel, dd_label1, dd_label2], outputs=[plt_figure])
 
110
  # return gr.update(choices=list(df.columns))
111
 
112
 
113
+ def reset_cate(df_categories):
114
+ if df_categories.equals(df_cate):
115
+ df_categories = pd.DataFrame(columns=['topic', 'description', 'expert'])
116
  else:
117
+ df_categories = df_cate.copy()
118
+ return df_categories
119
 
120
 
121
  global value
 
270
 
271
  #classification
272
  btn_classif.click(classification, inputs=[dd_source_class, fi_excel, df_category, sl_treshold], outputs=[fi_excel, df_output])
273
+ btn_reset_df.click(reset_cate, inputs=df_category, outputs=df_category)
274
 
275
  #charts
276
  btn_chart.click(create_bar_plot, inputs=[fi_excel, dd_label1, dd_label2], outputs=[plt_figure])