Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
"""
|
7 |
-
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
-
|
9 |
|
10 |
def respond(
|
11 |
message,
|
@@ -35,14 +32,10 @@ def respond(
|
|
35 |
top_p=top_p,
|
36 |
):
|
37 |
token = message.choices[0].delta.content
|
38 |
-
|
39 |
response += token
|
40 |
yield response
|
41 |
|
42 |
-
|
43 |
-
"""
|
44 |
-
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
45 |
-
"""
|
46 |
demo = gr.ChatInterface(
|
47 |
respond,
|
48 |
additional_inputs=[
|
@@ -59,6 +52,5 @@ demo = gr.ChatInterface(
|
|
59 |
],
|
60 |
)
|
61 |
|
62 |
-
|
63 |
if __name__ == "__main__":
|
64 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
+
# ایجاد کلاینت برای مدل aya-23-8B
|
5 |
+
client = InferenceClient("CohereForAI/aya-23-8B")
|
|
|
|
|
|
|
6 |
|
7 |
def respond(
|
8 |
message,
|
|
|
32 |
top_p=top_p,
|
33 |
):
|
34 |
token = message.choices[0].delta.content
|
|
|
35 |
response += token
|
36 |
yield response
|
37 |
|
38 |
+
# ایجاد رابط کاربری Gradio
|
|
|
|
|
|
|
39 |
demo = gr.ChatInterface(
|
40 |
respond,
|
41 |
additional_inputs=[
|
|
|
52 |
],
|
53 |
)
|
54 |
|
|
|
55 |
if __name__ == "__main__":
|
56 |
demo.launch()
|