Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,7 +48,7 @@ with gr.Blocks() as nps:
|
|
| 48 |
category_boxes = gr.State([]) # Store category input boxes as state
|
| 49 |
|
| 50 |
def display_categories(categories):
|
| 51 |
-
category_column.
|
| 52 |
for i, cat in enumerate(categories):
|
| 53 |
with category_column:
|
| 54 |
with gr.Row():
|
|
@@ -83,7 +83,7 @@ with gr.Blocks() as nps:
|
|
| 83 |
])
|
| 84 |
components.append(row)
|
| 85 |
return components
|
| 86 |
-
category_column = gr.
|
| 87 |
add_category_btn.click(fn=add_category, inputs=[category_boxes, category_input], outputs=category_boxes)
|
| 88 |
category_boxes.change(fn=display_categories, inputs=category_boxes, outputs=category_column)
|
| 89 |
category_boxes.change(fn=display_categories, inputs=category_boxes, outputs=category_column)
|
|
|
|
| 48 |
category_boxes = gr.State([]) # Store category input boxes as state
|
| 49 |
|
| 50 |
def display_categories(categories):
|
| 51 |
+
category_column.children = [] # Reset children to clear previous categories
|
| 52 |
for i, cat in enumerate(categories):
|
| 53 |
with category_column:
|
| 54 |
with gr.Row():
|
|
|
|
| 83 |
])
|
| 84 |
components.append(row)
|
| 85 |
return components
|
| 86 |
+
category_column = gr.Column()
|
| 87 |
add_category_btn.click(fn=add_category, inputs=[category_boxes, category_input], outputs=category_boxes)
|
| 88 |
category_boxes.change(fn=display_categories, inputs=category_boxes, outputs=category_column)
|
| 89 |
category_boxes.change(fn=display_categories, inputs=category_boxes, outputs=category_column)
|