Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,11 +5,14 @@ import gradio as gr
|
|
5 |
client = Client("dicta-il/dictalm2.0-instruct-demo")
|
6 |
|
7 |
def chat_with_model(history):
|
8 |
-
# ืงืืืช ืืืืืขื ืืืืจืื ื
|
9 |
prompt = history[-1]["content"]
|
10 |
-
#
|
11 |
-
result = client.predict(
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
# ืืฆืืจืช ืืืฉืง ืืชืงืื ืขื Gradio ืืฆืืจืช ืฆ'ื-ืืื ืืกืื ืื ืืงืืื
|
15 |
with gr.Blocks(theme="default") as demo:
|
@@ -25,7 +28,7 @@ with gr.Blocks(theme="default") as demo:
|
|
25 |
send_button = gr.Button("ืฉืื")
|
26 |
|
27 |
def user_chat(history, message):
|
28 |
-
# ืืืกืคืช ืืืืขืช ืืืฉืชืืฉ ืืืืกืืืจืื
|
29 |
return history + [{"role": "user", "content": message}], ""
|
30 |
|
31 |
# ืฉืืืืช ืืืืืขื ืื ืืืืืฆื ืขื Enter ืืื ืขื ืืื ืืืืฆื ืขื ืืคืชืืจ "ืฉืื"
|
|
|
5 |
client = Client("dicta-il/dictalm2.0-instruct-demo")
|
6 |
|
7 |
def chat_with_model(history):
|
8 |
+
# ืงืืืช ืืืืืขื ืืืืจืื ื ืืืืฉืชืืฉ
|
9 |
prompt = history[-1]["content"]
|
10 |
+
# ืงืจืืื ืืืืื ืืงืืืช ืชืืืื
|
11 |
+
result = client.predict(
|
12 |
+
message=prompt
|
13 |
+
)
|
14 |
+
# ืืืกืคืช ืืชืืืื ืืืืืื ืืืืกืืืจืื
|
15 |
+
return history + [{"role": "bot", "content": result}]
|
16 |
|
17 |
# ืืฆืืจืช ืืืฉืง ืืชืงืื ืขื Gradio ืืฆืืจืช ืฆ'ื-ืืื ืืกืื ืื ืืงืืื
|
18 |
with gr.Blocks(theme="default") as demo:
|
|
|
28 |
send_button = gr.Button("ืฉืื")
|
29 |
|
30 |
def user_chat(history, message):
|
31 |
+
# ืืืกืคืช ืืืืขืช ืืืฉืชืืฉ ืืืืกืืืจืื
|
32 |
return history + [{"role": "user", "content": message}], ""
|
33 |
|
34 |
# ืฉืืืืช ืืืืืขื ืื ืืืืืฆื ืขื Enter ืืื ืขื ืืื ืืืืฆื ืขื ืืคืชืืจ "ืฉืื"
|