From e140a936d204f63d496e4932b599517e41827a4b Mon Sep 17 00:00:00 2001 From: Wonderplex <50866817+Jasonqi146@users.noreply.github.com> Date: Wed, 1 May 2024 15:10:42 -0400 Subject: [PATCH] Fold Accordions (#73) * changed tab order * folded accordion except essential info --- sotopia_space/chat.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sotopia_space/chat.py b/sotopia_space/chat.py index 0844f36..f4f4129 100644 --- a/sotopia_space/chat.py +++ b/sotopia_space/chat.py @@ -165,7 +165,7 @@ def create_bot_goal(environment_dropdown): def sotopia_info_accordion(accordion_visible=True): environments, _, _, _ = get_sotopia_profiles() - with gr.Accordion("Create your sotopia space!", open=accordion_visible): + with gr.Accordion("Create your sotopia space!", open=False, visible=accordion_visible): with gr.Row(): environment_dropdown = gr.Dropdown( choices=environments, @@ -183,6 +183,10 @@ def sotopia_info_accordion(accordion_visible=True): with gr.Row(): user_agent_dropdown = create_user_agent_dropdown(environment_dropdown.value) bot_agent_dropdown = create_bot_agent_dropdown(environment_dropdown.value, user_agent_dropdown.value) + + with gr.Row(): + user_agent_info_display = create_user_info(user_agent_dropdown.value) + bot_agent_info_display = create_bot_info(bot_agent_dropdown.value) with gr.Accordion("Check your social task!", open=accordion_visible): @@ -193,11 +197,6 @@ def sotopia_info_accordion(accordion_visible=True): user_goal_display = create_user_goal(environment_dropdown.value) - - with gr.Row(): - bot_agent_info_display = create_bot_info(bot_agent_dropdown.value) - user_agent_info_display = create_user_info(user_agent_dropdown.value) - # Update user dropdown when scenario changes environment_dropdown.change(fn=create_user_agent_dropdown, inputs=[environment_dropdown], outputs=[user_agent_dropdown]) # Update bot dropdown when user or scenario changes