Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -47,10 +47,10 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
|
|
47 |
"""
|
48 |
)
|
49 |
|
50 |
-
with gr.Row():
|
51 |
chatbot_ui = gr.Chatbot(label="Chat Interface", height=400)
|
52 |
-
|
53 |
-
with gr.Row():
|
54 |
user_input = gr.Textbox(
|
55 |
label="Type Your Message",
|
56 |
placeholder="Ask me something...",
|
@@ -60,5 +60,16 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
|
|
60 |
send_button = gr.Button("Send", variant="primary")
|
61 |
clear_button = gr.Button("Clear Chat")
|
62 |
|
63 |
-
with gr.Row():
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
"""
|
48 |
)
|
49 |
|
50 |
+
with gr.Row(): # Ensure correct indentation here
|
51 |
chatbot_ui = gr.Chatbot(label="Chat Interface", height=400)
|
52 |
+
|
53 |
+
with gr.Row(): # Ensure correct indentation here
|
54 |
user_input = gr.Textbox(
|
55 |
label="Type Your Message",
|
56 |
placeholder="Ask me something...",
|
|
|
60 |
send_button = gr.Button("Send", variant="primary")
|
61 |
clear_button = gr.Button("Clear Chat")
|
62 |
|
63 |
+
with gr.Row(): # Ensure correct indentation here
|
64 |
+
gr.Examples(
|
65 |
+
examples=["Hello!", "Tell me a joke.", "What's the weather like?"],
|
66 |
+
inputs=user_input,
|
67 |
+
)
|
68 |
+
|
69 |
+
# Link components to functions
|
70 |
+
send_button.click(chatbot, inputs=[chatbot_ui], outputs=chatbot_ui)
|
71 |
+
clear_button.click(reset_chat, inputs=[], outputs=chatbot_ui)
|
72 |
+
|
73 |
+
# Launch the Gradio app
|
74 |
+
iface.launch()
|
75 |
+
|