Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,22 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
with gr.Blocks() as demo:
|
7 |
-
with gr.
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
11 |
|
12 |
-
|
13 |
-
fn=lambda x: chat.append("user", x),
|
14 |
-
inputs=user_input,
|
15 |
-
outputs=chat
|
16 |
-
)
|
17 |
-
send_button.click(
|
18 |
-
fn=reply,
|
19 |
-
inputs=user_input,
|
20 |
-
outputs=chat
|
21 |
-
)
|
22 |
|
23 |
demo.launch()
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
theme = gr.themes.Soft(
|
4 |
+
primary_hue="zinc",
|
5 |
+
secondary_hue="green",
|
6 |
+
neutral_hue="blue",
|
7 |
+
text_size=gr.themes.sizes.text_sm,
|
8 |
+
)
|
9 |
|
10 |
+
with gr.Blocks(theme=theme) as demo:
|
11 |
+
with gr.Column():
|
12 |
+
with gr.Accordion("Sistem Mesajları", open=False):
|
13 |
+
system_msg = gr.Textbox(value="Sistemden mesajlar burada görüntülenecek.")
|
14 |
+
new_msg = gr.Textbox(value="Yeni mesajınızı buraya yazın.")
|
15 |
+
chatbot = gr.Chatbot(label='Trek Asistanı', elem_id="chatbot")
|
16 |
+
inputs = gr.Textbox(placeholder="Mesajınızı buraya yazın...", show_label=False)
|
17 |
+
state = gr.State([])
|
18 |
|
19 |
+
inputs.submit(predict, [system_msg, inputs, chatbot, state], [chatbot, state])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
demo.launch()
|
22 |
+
|