gokaygokay commited on
Commit
f37a890
1 Parent(s): edadc03
Files changed (1) hide show
  1. ui_components.py +6 -1
ui_components.py CHANGED
@@ -108,7 +108,12 @@ def create_interface():
108
  with gr.Accordion(f"{category.capitalize()} Options", open=False):
109
  category_components = {}
110
  for field, data in fields.items():
111
- options = ["None", "Random", "Multiple Random"] + data.get("items", [])
 
 
 
 
 
112
  category_components[field] = gr.Dropdown(options, label=field.capitalize(), value="None")
113
  next_components[category] = category_components
114
 
 
108
  with gr.Accordion(f"{category.capitalize()} Options", open=False):
109
  category_components = {}
110
  for field, data in fields.items():
111
+ if isinstance(data, list):
112
+ options = ["None", "Random", "Multiple Random"] + data
113
+ elif isinstance(data, dict):
114
+ options = ["None", "Random", "Multiple Random"] + data.get("items", [])
115
+ else:
116
+ options = ["None", "Random", "Multiple Random"]
117
  category_components[field] = gr.Dropdown(options, label=field.capitalize(), value="None")
118
  next_components[category] = category_components
119