Update app.py
Browse files
app.py
CHANGED
|
@@ -205,7 +205,7 @@ def respond(message, history: list[dict], username):
|
|
| 205 |
with gr.Blocks() as demo:
|
| 206 |
username = gr.State()
|
| 207 |
|
| 208 |
-
with gr.Column():
|
| 209 |
username_input = gr.Textbox(label="Enter your username to start.\nIf you're new, enter 'Guest'")
|
| 210 |
submit_button = gr.Button("Start Chat")
|
| 211 |
|
|
@@ -220,12 +220,12 @@ with gr.Blocks() as demo:
|
|
| 220 |
)
|
| 221 |
|
| 222 |
def start_chatbot(name):
|
| 223 |
-
return gr.update(visible=True), name
|
| 224 |
|
| 225 |
submit_button.click(
|
| 226 |
fn=start_chatbot,
|
| 227 |
inputs=username_input,
|
| 228 |
-
outputs=[chatbot_container, username]
|
| 229 |
)
|
| 230 |
'''
|
| 231 |
demo = gr.ChatInterface(
|
|
|
|
| 205 |
with gr.Blocks() as demo:
|
| 206 |
username = gr.State()
|
| 207 |
|
| 208 |
+
with gr.Column(visible=True) as login_container:
|
| 209 |
username_input = gr.Textbox(label="Enter your username to start.\nIf you're new, enter 'Guest'")
|
| 210 |
submit_button = gr.Button("Start Chat")
|
| 211 |
|
|
|
|
| 220 |
)
|
| 221 |
|
| 222 |
def start_chatbot(name):
|
| 223 |
+
return gr.update(visible=False), gr.update(visible=True), name
|
| 224 |
|
| 225 |
submit_button.click(
|
| 226 |
fn=start_chatbot,
|
| 227 |
inputs=username_input,
|
| 228 |
+
outputs=[login_container, chatbot_container, username]
|
| 229 |
)
|
| 230 |
'''
|
| 231 |
demo = gr.ChatInterface(
|