Spaces:
Running
Running
Update chat_app_remote.py
Browse files- 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
|
|
|
|
|
91 |
|
92 |
with gr.Tabs() as tabs:
|
93 |
with gr.Tab("Chat"):
|
94 |
-
#
|
95 |
-
session_display = gr.Markdown(
|
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 |
-
|
104 |
-
|
|
|
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(
|