JuiKuang commited on
Commit
0c4b013
·
verified ·
1 Parent(s): 2b1a515

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
 
@@ -41,20 +41,20 @@ def respond(
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=[
49
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
50
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
51
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
52
  gr.Slider(
53
  minimum=0.1,
54
  maximum=1.0,
55
  value=0.95,
56
  step=0.05,
57
- label="Top-p (nucleus sampling)",
58
  ),
59
  ],
60
  )
 
2
  from huggingface_hub import InferenceClient
3
 
4
  """
5
+ 更多關於 `huggingface_hub` Inference API 支援的資訊,請參閱文件:https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
6
  """
7
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
8
 
 
41
 
42
 
43
  """
44
+ 如果需要自訂 ChatInterface,請參考 gradio 文件:https://www.gradio.app/docs/chatinterface
45
  """
46
  demo = gr.ChatInterface(
47
  respond,
48
  additional_inputs=[
49
+ gr.Textbox(value="你是一個友善的聊天機器人。", label="系統訊息"),
50
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="最大新生成字元數"),
51
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="溫度 (Temperature)"),
52
  gr.Slider(
53
  minimum=0.1,
54
  maximum=1.0,
55
  value=0.95,
56
  step=0.05,
57
+ label="Top-p (核採樣)",
58
  ),
59
  ],
60
  )