Update app.py
Browse files
app.py
CHANGED
@@ -64,14 +64,13 @@ def respond_stream(message, history):
|
|
64 |
yield f"Error during generation: {e}"
|
65 |
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
chatbot = gr.Chatbot() #
|
70 |
-
chatbot.set_welcome_message(get_random_greeting())
|
71 |
|
72 |
with gr.Blocks() as demo:
|
73 |
chatbot.render()
|
74 |
clear = gr.Button("Clear")
|
75 |
-
clear.click(lambda: None, None, chatbot, fn=lambda: [])
|
76 |
-
|
77 |
-
|
|
|
64 |
yield f"Error during generation: {e}"
|
65 |
|
66 |
|
67 |
+
# Display the welcome message as the first assistant message
|
68 |
+
initial_message = random.choice(GREETING_MESSAGES)
|
69 |
+
chatbot = gr.Chatbot(value=[[None, initial_message]]) # Set initial value here
|
|
|
70 |
|
71 |
with gr.Blocks() as demo:
|
72 |
chatbot.render()
|
73 |
clear = gr.Button("Clear")
|
74 |
+
clear.click(lambda: None, None, chatbot, fn=lambda: [])
|
75 |
+
|
76 |
+
demo.queue().launch()
|