Skip to content

Commit

Permalink
minor change to layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasonqi146 committed May 2, 2024
1 parent e2fad4e commit a492c45
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sotopia_space/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,17 @@ def sotopia_info_accordion(accordion_visible=True):
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):

scenario_info_display = create_environment_info(environment_dropdown.value)

with gr.Row():
bot_goal_display = create_bot_goal(environment_dropdown.value)
user_agent_info_display = create_user_info(user_agent_dropdown.value)
bot_agent_info_display = create_bot_info(bot_agent_dropdown.value)

with gr.Row():
# bot_goal_display = create_bot_goal(environment_dropdown.value)
user_goal_display = create_user_goal(environment_dropdown.value)


Expand All @@ -208,7 +209,7 @@ def sotopia_info_accordion(accordion_visible=True):
# Update user goal when scenario changes
environment_dropdown.change(fn=create_user_goal, inputs=[environment_dropdown], outputs=[user_goal_display])
# Update bot goal when scenario changes
environment_dropdown.change(fn=create_bot_goal, inputs=[environment_dropdown], outputs=[bot_goal_display])
# environment_dropdown.change(fn=create_bot_goal, inputs=[environment_dropdown], outputs=[bot_goal_display])

return model_name_dropdown, environment_dropdown, user_agent_dropdown, bot_agent_dropdown

Expand Down Expand Up @@ -252,7 +253,7 @@ def run_chat(

with gr.Column():
with gr.Accordion("Start the conversation to achieve your goal!", open=True):
gr.ChatInterface(
chat_interface = gr.ChatInterface(
fn=run_chat,
chatbot=gr.Chatbot(
height=620,
Expand Down

0 comments on commit a492c45

Please sign in to comment.