Respair commited on
Commit
b42c71b
·
verified ·
1 Parent(s): d87c1dc

Update chat_app_remote.py

Browse files
Files changed (1) hide show
  1. chat_app_remote.py +8 -5
chat_app_remote.py CHANGED
@@ -87,12 +87,14 @@ def create_frontend_demo():
87
  Create and configure the Gradio interface.
88
  """
89
  with gr.Blocks(css=custom_css, theme="Respair/[email protected]") as demo:
90
- session_id_state = gr.State("")
 
 
91
 
92
  with gr.Tabs() as tabs:
93
  with gr.Tab("Chat"):
94
- # Chat interface elements
95
- session_display = gr.Markdown("Current Session ID: None", label="Session ID")
96
  chatbot = gr.Chatbot(
97
  label="Conversation History",
98
  height=400,
@@ -100,8 +102,9 @@ def create_frontend_demo():
100
  placeholder="Start chatting with Aira..."
101
  )
102
 
103
- gr.Markdown("""Please, Go to the options tab and set a session ID. don't start with a None.
104
- <br> オプションタブに移動して、セッションIDを設定してください。Noneから始めないでください""")
 
105
 
106
  with gr.Column():
107
  msg = gr.Textbox(
 
87
  Create and configure the Gradio interface.
88
  """
89
  with gr.Blocks(css=custom_css, theme="Respair/[email protected]") as demo:
90
+ # Initialize session_id_state with a new random session ID
91
+ initial_session_id, _, initial_display_text = set_session("")
92
+ session_id_state = gr.State(value=initial_session_id)
93
 
94
  with gr.Tabs() as tabs:
95
  with gr.Tab("Chat"):
96
+ # Update initial session display with the auto-generated ID
97
+ session_display = gr.Markdown(initial_display_text, label="Session ID")
98
  chatbot = gr.Chatbot(
99
  label="Conversation History",
100
  height=400,
 
102
  placeholder="Start chatting with Aira..."
103
  )
104
 
105
+ # Update the instruction text since session ID is now automatic
106
+ gr.Markdown("""Start chatting with Aira! You can use text or voice input.
107
+ <br> アイラとチャットを始めましょう!テキストまたは音声入力が使えます。""")
108
 
109
  with gr.Column():
110
  msg = gr.Textbox(