Shamik commited on
Commit
d1e9515
·
verified ·
1 Parent(s): 8b9a4c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -43,21 +43,30 @@ def respond(
43
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
44
  """
45
  demo = gr.ChatInterface(
46
- respond,
 
 
47
  additional_inputs=[
48
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
49
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
50
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
 
 
51
  gr.Slider(
52
  minimum=0.1,
53
  maximum=1.0,
54
  value=0.95,
55
  step=0.05,
56
  label="Top-p (nucleus sampling)",
57
- ),
 
58
  ],
 
 
 
 
59
  )
60
 
61
 
62
  if __name__ == "__main__":
63
- demo.launch()
 
43
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
44
  """
45
  demo = gr.ChatInterface(
46
+ fn=respond,
47
+ chatbot=gr.Chatbot(show_label=False, show_share_button=False,
48
+ show_copy_button=True, likeable=True, layout="panel"),
49
  additional_inputs=[
50
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
51
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens",interactive=True,
52
+ info="The maximum numbers of new tokens"),
53
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature",interactive=True,
54
+ info="Higher values produce more diverse outputs"),
55
  gr.Slider(
56
  minimum=0.1,
57
  maximum=1.0,
58
  value=0.95,
59
  step=0.05,
60
  label="Top-p (nucleus sampling)",
61
+ interactive=True,
62
+ info="Higher values sample more low-probability tokens"),
63
  ],
64
+ examples=[
65
+ ["Can you explain briefly to me what is the Python programming language?"],
66
+ ["Write a 100-word article on 'Benefits of Open-Source in AI research'"],
67
+ ]
68
  )
69
 
70
 
71
  if __name__ == "__main__":
72
+ demo.launch(show_api=False)