EITD commited on
Commit
ac446a2
·
1 Parent(s): 1975e5f
Files changed (1) hide show
  1. app.py +18 -17
app.py CHANGED
@@ -1,5 +1,6 @@
1
  from peft import AutoPeftModelForCausalLM
2
  from transformers import AutoTokenizer
 
3
  """
4
  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
5
  """
@@ -72,22 +73,22 @@ def respond(
72
  """
73
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
74
  """
75
- # demo = gr.ChatInterface(
76
- # respond,
77
- # additional_inputs=[
78
- # gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
79
- # gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
80
- # gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
81
- # gr.Slider(
82
- # minimum=0.1,
83
- # maximum=1.0,
84
- # value=0.95,
85
- # step=0.05,
86
- # label="Top-p (nucleus sampling)",
87
- # ),
88
- # ],
89
- # )
90
 
91
 
92
- # if __name__ == "__main__":
93
- # demo.launch()
 
1
  from peft import AutoPeftModelForCausalLM
2
  from transformers import AutoTokenizer
3
+ import gradio as gr
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
  """
 
73
  """
74
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
75
  """
76
+ demo = gr.ChatInterface(
77
+ respond,
78
+ additional_inputs=[
79
+ gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
80
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
81
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
82
+ gr.Slider(
83
+ minimum=0.1,
84
+ maximum=1.0,
85
+ value=0.95,
86
+ step=0.05,
87
+ label="Top-p (nucleus sampling)",
88
+ ),
89
+ ],
90
+ )
91
 
92
 
93
+ if __name__ == "__main__":
94
+ demo.launch()