ZennyKenny commited on
Commit
b452d2a
Β·
verified Β·
1 Parent(s): 5ef60a2

resolve UI issue

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -46,9 +46,9 @@ with gr.Blocks() as nps:
46
  return category_boxes
47
 
48
  category_boxes = [] # Store category input boxes
49
- category_column = gr.Column()
50
  add_category_btn = gr.Button("Add Category")
51
- add_category_btn.click(fn=add_category, outputs=category_column)
52
  uploaded_file = gr.File(label="Upload CSV", type="filepath")
53
  template_btn = gr.Button("Use Template")
54
  gr.Markdown("# NPS Comment Categorization")
@@ -75,7 +75,7 @@ with gr.Blocks() as nps:
75
 
76
  uploaded_file.change(fn=load_data, inputs=uploaded_file, outputs=output)
77
  template_btn.click(fn=lambda: "Using Template Dataset", outputs=output)
78
- template_btn.click(fn=lambda: [gr.Textbox.update(value="Product Experience"), gr.Textbox.update(value="Customer Support"), gr.Textbox.update(value="Price of Service"), gr.Textbox.update(value="Other")], outputs=category_column)
79
  classify_btn.click(fn=classify_comments, inputs=category_boxes, outputs=output)
80
 
81
  nps.launch()
 
46
  return category_boxes
47
 
48
  category_boxes = [] # Store category input boxes
49
+ category_column = gr.Row()
50
  add_category_btn = gr.Button("Add Category")
51
+ add_category_btn.click(fn=add_category, outputs=category_boxes)
52
  uploaded_file = gr.File(label="Upload CSV", type="filepath")
53
  template_btn = gr.Button("Use Template")
54
  gr.Markdown("# NPS Comment Categorization")
 
75
 
76
  uploaded_file.change(fn=load_data, inputs=uploaded_file, outputs=output)
77
  template_btn.click(fn=lambda: "Using Template Dataset", outputs=output)
78
+ template_btn.click(fn=lambda: ["Product Experience", "Customer Support", "Price of Service", "Other"], outputs=category_boxes)
79
  classify_btn.click(fn=classify_comments, inputs=category_boxes, outputs=output)
80
 
81
  nps.launch()