From fbf7a6578c56debb8ea5993ee5a11c5b4dc933f1 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 18 Feb 2024 22:50:20 +0100 Subject: [PATCH] Add visibility option for engine dropdown --- ui/gradio_ui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/gradio_ui.py b/ui/gradio_ui.py index 7588a3e..34c81f6 100644 --- a/ui/gradio_ui.py +++ b/ui/gradio_ui.py @@ -46,6 +46,7 @@ class GenerateUI: with gr.Blocks() as col1: for engine_type, engines in ENGINES.items(): multiselect = engines["multiple"] + show_dropdown = engines.get("show_dropdown", True) engines = engines["classes"] with gr.Tab(engine_type) as engine_tab: engine_names = [engine.name for engine in engines] @@ -54,6 +55,7 @@ class GenerateUI: value=engine_names[0], multiselect=multiselect, label="Engine provider:" if not multiselect else "Engine providers:", + visible=show_dropdown, ) inputs.append(engine_dropdown) engine_rows = [] @@ -61,7 +63,7 @@ class GenerateUI: with gr.Group( visible=(i == 0) ) as engine_row: - gr.Label(engine.name) + gr.Markdown(value = " ", label=f"{engine.name}", show_label=True) engine_rows.append(engine_row) options = engine.get_options() inputs.extend(options)