Xolkin commited on
Commit
d50b213
·
verified ·
1 Parent(s): 87d732e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
  """
5
- For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
6
  """
7
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
8
 
@@ -24,7 +24,7 @@ def respond(
24
 
25
  messages.append({"role": "user", "content": message})
26
 
27
- # Check if the message is a greeting or a request for medical information
28
  if message.lower() in ["привет", "здравствуйте", "hello", "hi"]:
29
  response = "Привет! Как я могу помочь вам сегодня?"
30
  elif "предварительный диагноз" in message.lower() or "операция" in message.lower():
@@ -48,12 +48,12 @@ def respond(
48
  yield response
49
 
50
  """
51
- For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
52
  """
53
  demo = gr.ChatInterface(
54
  respond,
55
  additional_inputs=[
56
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
57
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
58
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
59
  gr.Slider(
 
2
  from huggingface_hub import InferenceClient
3
 
4
  """
5
+ Для получения дополнительной информации о поддержке Inference API в `huggingface_hub` ознакомьтесь с документацией: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
6
  """
7
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
8
 
 
24
 
25
  messages.append({"role": "user", "content": message})
26
 
27
+ # Проверка на приветствие или запрос медицинской информации
28
  if message.lower() in ["привет", "здравствуйте", "hello", "hi"]:
29
  response = "Привет! Как я могу помочь вам сегодня?"
30
  elif "предварительный диагноз" in message.lower() or "операция" in message.lower():
 
48
  yield response
49
 
50
  """
51
+ Для получения информации о том, как настроить ChatInterface, ознакомьтесь с документацией gradio: https://www.gradio.app/docs/chatinterface
52
  """
53
  demo = gr.ChatInterface(
54
  respond,
55
  additional_inputs=[
56
+ gr.Textbox(value="Предварительный диагноз: Операция: (требуется или нет, то какая)", label="System message"),
57
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
58
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
59
  gr.Slider(