Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,10 +12,14 @@ def chat_with_model(history):
|
|
12 |
)
|
13 |
return history + [{"role": "user", "content": prompt}, {"role": "bot", "content": result}]
|
14 |
|
15 |
-
# ืืฆืืจืช ืืืฉืง ืืชืงืื ืขื Gradio ืืฆืืจืช ืฆ'ื-ืืื
|
16 |
with gr.Blocks(theme="default") as demo:
|
17 |
-
gr.
|
18 |
-
|
|
|
|
|
|
|
|
|
19 |
chatbot = gr.Chatbot(label="ืฆ'ืื ืขื ืืืื DictaLM", type="messages")
|
20 |
with gr.Row():
|
21 |
user_input = gr.Textbox(placeholder="ืืื ืก ืืช ืืืืืขื ืฉืื ืืื...", label="", lines=1)
|
@@ -24,6 +28,7 @@ with gr.Blocks(theme="default") as demo:
|
|
24 |
def user_chat(history, message):
|
25 |
return history + [{"role": "user", "content": message}], ""
|
26 |
|
|
|
27 |
user_input.submit(user_chat, inputs=[chatbot, user_input], outputs=[chatbot, user_input], queue=False)
|
28 |
user_input.submit(chat_with_model, inputs=chatbot, outputs=chatbot)
|
29 |
send_button.click(user_chat, inputs=[chatbot, user_input], outputs=[chatbot, user_input], queue=False)
|
|
|
12 |
)
|
13 |
return history + [{"role": "user", "content": prompt}, {"role": "bot", "content": result}]
|
14 |
|
15 |
+
# ืืฆืืจืช ืืืฉืง ืืชืงืื ืขื Gradio ืืฆืืจืช ืฆ'ื-ืืื ืืกืื ืื ืืงืืื
|
16 |
with gr.Blocks(theme="default") as demo:
|
17 |
+
gr.HTML("""
|
18 |
+
<div style="background-color: #f5f5f5; padding: 20px; text-align: center;">
|
19 |
+
<h1 style="color: #003366; font-family: 'Trebuchet MS', sans-serif;">ืฆ'ืื ืขื ืืืื DictaLM</h1>
|
20 |
+
<p style="font-family: 'Trebuchet MS', sans-serif; color: #333;">ืืจืืืื ืืืืื ืืฆ'ืื ืืืื ืืจืืงืืืื ืฉืื ื, ืืืืคืฉืจ ืืื ืืืชื ืกืืช ืืฉืืื ืขื ืืืื AI ืืชืงืื.</p>
|
21 |
+
</div>
|
22 |
+
""")
|
23 |
chatbot = gr.Chatbot(label="ืฆ'ืื ืขื ืืืื DictaLM", type="messages")
|
24 |
with gr.Row():
|
25 |
user_input = gr.Textbox(placeholder="ืืื ืก ืืช ืืืืืขื ืฉืื ืืื...", label="", lines=1)
|
|
|
28 |
def user_chat(history, message):
|
29 |
return history + [{"role": "user", "content": message}], ""
|
30 |
|
31 |
+
# ืชืืืื ืืืืืฆื ืขื Enter ืื ืืกืฃ ืืืืฆื "ืฉืื"
|
32 |
user_input.submit(user_chat, inputs=[chatbot, user_input], outputs=[chatbot, user_input], queue=False)
|
33 |
user_input.submit(chat_with_model, inputs=chatbot, outputs=chatbot)
|
34 |
send_button.click(user_chat, inputs=[chatbot, user_input], outputs=[chatbot, user_input], queue=False)
|