Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -22,11 +22,11 @@ def chat(input_text, history=[]):
|
|
22 |
|
23 |
# Update the conversation history
|
24 |
history.append((input_text, response))
|
25 |
-
return history, history
|
26 |
|
27 |
|
28 |
with gr.Blocks() as app:
|
29 |
-
gr.Markdown("<h1 style='text-align: center;'>ุฏุฑุฏุดุฉ
|
30 |
chatbot = gr.Chatbot(label="ุงูู
ุญุงุฏุซุฉ")
|
31 |
state = gr.State([])
|
32 |
|
@@ -35,7 +35,20 @@ with gr.Blocks() as app:
|
|
35 |
send_button = gr.Button("ุฅุฑุณุงู")
|
36 |
|
37 |
# Link the chat function to both text submission and button click
|
38 |
-
txt.submit(chat, [txt, state], [chatbot, state])
|
39 |
-
send_button.click(chat, [txt, state], [chatbot, state])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
app.launch()
|
|
|
22 |
|
23 |
# Update the conversation history
|
24 |
history.append((input_text, response))
|
25 |
+
return history, history,""
|
26 |
|
27 |
|
28 |
with gr.Blocks() as app:
|
29 |
+
gr.Markdown("<h1 style='text-align: center;'>ุฏุฑุฏุดุฉ ุฃุทูุณ</h1>")
|
30 |
chatbot = gr.Chatbot(label="ุงูู
ุญุงุฏุซุฉ")
|
31 |
state = gr.State([])
|
32 |
|
|
|
35 |
send_button = gr.Button("ุฅุฑุณุงู")
|
36 |
|
37 |
# Link the chat function to both text submission and button click
|
38 |
+
txt.submit(chat, [txt, state], [chatbot, state,txt])
|
39 |
+
send_button.click(chat, [txt, state], [chatbot, state,txt])
|
40 |
+
|
41 |
+
examples = [
|
42 |
+
["ู
ุฑุญุจุงู! ููู ูู
ูููู ู
ุณุงุนุฏุชู ุงูููู
ุ"],
|
43 |
+
["ู
ุง ูู ุฃุญุฏุซ ุฃุฎุจุงุฑ ุงูุฐูุงุก ุงูุงุตุทูุงุนูุ"],
|
44 |
+
["ููู ูู
ูููู ุงูุจุฏุก ูู ุชุนูู
ุงูุจุฑู
ุฌุฉุ"]
|
45 |
+
]
|
46 |
+
|
47 |
+
gr.Examples(
|
48 |
+
examples=examples,
|
49 |
+
inputs=txt,
|
50 |
+
label="ุฃู
ุซูุฉ ุนูู ุงูุฃุณุฆูุฉ",
|
51 |
+
description="ุงุฎุชุฑ ู
ู ุงูุฃู
ุซูุฉ ุฃุฏูุงู ููุจุฏุก."
|
52 |
+
)
|
53 |
|
54 |
app.launch()
|