Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def respond(message, chat_history):
|
| 4 |
+
bot_message = "You said: " + message
|
| 5 |
+
chat_history.append((message, bot_message))
|
| 6 |
+
return "", chat_history
|
| 7 |
+
|
| 8 |
+
# Customize the chatbot component
|
| 9 |
+
my_chatbot = gr.Chatbot(
|
| 10 |
+
label="My Chatbot with Custom Properties",
|
| 11 |
+
height=400,
|
| 12 |
+
show_label=True
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
# Customize the textbox component
|
| 16 |
+
my_textbox = gr.Textbox(
|
| 17 |
+
label="Type Your Message Here!",
|
| 18 |
+
placeholder="Say something nice...",
|
| 19 |
+
lines=3
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
with gr.Blocks() as demo:
|
| 23 |
+
gr.ChatInterface(
|
| 24 |
+
fn=respond,
|
| 25 |
+
chatbot=my_chatbot,
|
| 26 |
+
textbox=my_textbox,
|
| 27 |
+
theme=gr.themes.Soft()
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
demo.launch()
|