Spaces:
Running on Zero
Running on Zero
UI: pin 09_qwen_agentic_actions at top of Examples dropdown and default-select it
Browse files- kimodo/demo/ui.py +7 -7
kimodo/demo/ui.py
CHANGED
|
@@ -288,8 +288,9 @@ def create_gui(
|
|
| 288 |
with client.gui.add_folder("Examples", expand_by_default=True):
|
| 289 |
examples_base_dir = demo.get_examples_base_dir(model_name, absolute=True)
|
| 290 |
example_dict = viser_utils.load_example_cases(examples_base_dir)
|
| 291 |
-
|
| 292 |
-
|
|
|
|
| 293 |
gui_examples_debug = client.gui.add_markdown(
|
| 294 |
content=f"Examples loaded: {len(example_names)} | Has 09: {QWEN_EXAMPLE_NAME in example_names}"
|
| 295 |
)
|
|
@@ -302,7 +303,7 @@ def create_gui(
|
|
| 302 |
gui_examples_dropdown = client.gui.add_dropdown(
|
| 303 |
"Example",
|
| 304 |
options=example_names,
|
| 305 |
-
initial_value=
|
| 306 |
)
|
| 307 |
gui_load_example_button = client.gui.add_button(
|
| 308 |
"Load Example",
|
|
@@ -325,9 +326,8 @@ def create_gui(
|
|
| 325 |
f" client={client_id} model={model_name} keep_selection={keep_selection}"
|
| 326 |
f" incoming_count={len(new_example_dict)} current_value={gui_examples_dropdown.value}"
|
| 327 |
)
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
example_names_local.append(QWEN_EXAMPLE_NAME)
|
| 331 |
if QWEN_EXAMPLE_LEGACY_NAME not in example_names_local:
|
| 332 |
example_names_local.append(QWEN_EXAMPLE_LEGACY_NAME)
|
| 333 |
gui_examples_dropdown.options = example_names_local
|
|
@@ -344,7 +344,7 @@ def create_gui(
|
|
| 344 |
)
|
| 345 |
if keep_selection and gui_examples_dropdown.value in example_names_local:
|
| 346 |
return
|
| 347 |
-
gui_examples_dropdown.value =
|
| 348 |
|
| 349 |
with client.gui.add_folder("Generate", expand_by_default=True):
|
| 350 |
gui_duration = client.gui.add_markdown(content=f"Total duration: {DEFAULT_CUR_DURATION:.1f} (sec)")
|
|
|
|
| 288 |
with client.gui.add_folder("Examples", expand_by_default=True):
|
| 289 |
examples_base_dir = demo.get_examples_base_dir(model_name, absolute=True)
|
| 290 |
example_dict = viser_utils.load_example_cases(examples_base_dir)
|
| 291 |
+
disk_example_names = [name for name in list(example_dict.keys()) if name != QWEN_EXAMPLE_NAME]
|
| 292 |
+
# Keep 09 visible and selected by default so it is impossible to miss.
|
| 293 |
+
example_names = [QWEN_EXAMPLE_NAME] + disk_example_names
|
| 294 |
gui_examples_debug = client.gui.add_markdown(
|
| 295 |
content=f"Examples loaded: {len(example_names)} | Has 09: {QWEN_EXAMPLE_NAME in example_names}"
|
| 296 |
)
|
|
|
|
| 303 |
gui_examples_dropdown = client.gui.add_dropdown(
|
| 304 |
"Example",
|
| 305 |
options=example_names,
|
| 306 |
+
initial_value=QWEN_EXAMPLE_NAME,
|
| 307 |
)
|
| 308 |
gui_load_example_button = client.gui.add_button(
|
| 309 |
"Load Example",
|
|
|
|
| 326 |
f" client={client_id} model={model_name} keep_selection={keep_selection}"
|
| 327 |
f" incoming_count={len(new_example_dict)} current_value={gui_examples_dropdown.value}"
|
| 328 |
)
|
| 329 |
+
disk_names_local = [name for name in list(new_example_dict.keys()) if name != QWEN_EXAMPLE_NAME]
|
| 330 |
+
example_names_local = [QWEN_EXAMPLE_NAME] + disk_names_local
|
|
|
|
| 331 |
if QWEN_EXAMPLE_LEGACY_NAME not in example_names_local:
|
| 332 |
example_names_local.append(QWEN_EXAMPLE_LEGACY_NAME)
|
| 333 |
gui_examples_dropdown.options = example_names_local
|
|
|
|
| 344 |
)
|
| 345 |
if keep_selection and gui_examples_dropdown.value in example_names_local:
|
| 346 |
return
|
| 347 |
+
gui_examples_dropdown.value = QWEN_EXAMPLE_NAME
|
| 348 |
|
| 349 |
with client.gui.add_folder("Generate", expand_by_default=True):
|
| 350 |
gui_duration = client.gui.add_markdown(content=f"Total duration: {DEFAULT_CUR_DURATION:.1f} (sec)")
|