Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,6 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
6 |
"""
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
|
9 |
-
|
10 |
def respond(
|
11 |
message,
|
12 |
history: list[tuple[str, str]],
|
@@ -15,8 +14,8 @@ def respond(
|
|
15 |
temperature,
|
16 |
top_p,
|
17 |
):
|
18 |
-
#
|
19 |
-
system_message = "Привет! Я
|
20 |
|
21 |
messages = [{"role": "system", "content": system_message}]
|
22 |
|
@@ -42,14 +41,13 @@ def respond(
|
|
42 |
response += token
|
43 |
yield response
|
44 |
|
45 |
-
|
46 |
"""
|
47 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
48 |
"""
|
49 |
demo = gr.ChatInterface(
|
50 |
respond,
|
51 |
additional_inputs=[
|
52 |
-
gr.Textbox(value="
|
53 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
54 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
55 |
gr.Slider(
|
@@ -62,6 +60,5 @@ demo = gr.ChatInterface(
|
|
62 |
],
|
63 |
)
|
64 |
|
65 |
-
|
66 |
if __name__ == "__main__":
|
67 |
demo.launch()
|
|
|
6 |
"""
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
|
|
|
9 |
def respond(
|
10 |
message,
|
11 |
history: list[tuple[str, str]],
|
|
|
14 |
temperature,
|
15 |
top_p,
|
16 |
):
|
17 |
+
# Set the system message to the desired greeting
|
18 |
+
system_message = "Привет! Я доктор в больнице EMS штата Alta! Напиши внизу симптомы заболевания и я поставлю предварительный диагноз! И хирургическую операцию, если надо будет ее провести."
|
19 |
|
20 |
messages = [{"role": "system", "content": system_message}]
|
21 |
|
|
|
41 |
response += token
|
42 |
yield response
|
43 |
|
|
|
44 |
"""
|
45 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
46 |
"""
|
47 |
demo = gr.ChatInterface(
|
48 |
respond,
|
49 |
additional_inputs=[
|
50 |
+
gr.Textbox(value="Я - доктор.", label="System message"),
|
51 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
52 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
53 |
gr.Slider(
|
|
|
60 |
],
|
61 |
)
|
62 |
|
|
|
63 |
if __name__ == "__main__":
|
64 |
demo.launch()
|