Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -46,15 +46,15 @@ with gr.Blocks() as nps:
|
|
46 |
def add_category(categories, new_category):
|
47 |
if new_category.strip() != "" and len(categories) < 5: # Limit to 5 categories
|
48 |
categories.append(new_category.strip())
|
49 |
-
return categories, "", f"**Categories:**\n" + "\n".join([f"- {cat}
|
50 |
|
51 |
# Function to remove a category
|
52 |
def remove_category(categories, category_to_remove):
|
53 |
if category_to_remove in categories:
|
54 |
categories.remove(category_to_remove)
|
55 |
-
return categories, f"**Categories:**\n" + "\n".join([f"- {cat}
|
56 |
|
57 |
-
# Function to display categories
|
58 |
def display_categories(categories):
|
59 |
category_rows = []
|
60 |
for cat in categories:
|
@@ -106,7 +106,7 @@ with gr.Blocks() as nps:
|
|
106 |
# Function to use template categories
|
107 |
def use_template():
|
108 |
template_categories = ["Product Experience", "Customer Support", "Price of Service", "Other"]
|
109 |
-
return template_categories, f"**Categories:**\n" + "\n".join([f"- {cat}
|
110 |
|
111 |
# Event handlers
|
112 |
add_category_btn.click(
|
|
|
46 |
def add_category(categories, new_category):
|
47 |
if new_category.strip() != "" and len(categories) < 5: # Limit to 5 categories
|
48 |
categories.append(new_category.strip())
|
49 |
+
return categories, "", f"**Categories:**\n" + "\n".join([f"- {cat}" for cat in categories])
|
50 |
|
51 |
# Function to remove a category
|
52 |
def remove_category(categories, category_to_remove):
|
53 |
if category_to_remove in categories:
|
54 |
categories.remove(category_to_remove)
|
55 |
+
return categories, f"**Categories:**\n" + "\n".join([f"- {cat}" for cat in categories])
|
56 |
|
57 |
+
# Function to display categories
|
58 |
def display_categories(categories):
|
59 |
category_rows = []
|
60 |
for cat in categories:
|
|
|
106 |
# Function to use template categories
|
107 |
def use_template():
|
108 |
template_categories = ["Product Experience", "Customer Support", "Price of Service", "Other"]
|
109 |
+
return template_categories, f"**Categories:**\n" + "\n".join([f"- {cat}" for cat in template_categories])
|
110 |
|
111 |
# Event handlers
|
112 |
add_category_btn.click(
|