ysharma HF staff commited on
Commit
70f7eee
1 Parent(s): b4954ec

update layout; added a column container

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -61,19 +61,20 @@ Assistant: <utterance>
61
  In this app, you can explore the outputs of a 20B large language model.
62
  """
63
 
64
- with gr.Blocks(css = "#chatbot {width: 700px; height: 400px; overflow: auto;}") as demo:
65
  gr.HTML(title)
66
- chatbot = gr.Chatbot(elem_id='chatbot') #c
67
- inputs = gr.Textbox(placeholder= "Hi my name is Joe.", label= "Type an input and press Enter") #t
68
- state = gr.State([]) #s
69
- b1 = gr.Button()
70
-
71
- #inputs, top_p, temperature, top_k, repetition_penalty
72
- with gr.Accordion("Parameters", open=False):
73
- top_p = gr.Slider( minimum=-0, maximum=1.0, value=0.95, step=0.05, interactive=True, label="Top-p (nucleus sampling)",)
74
- temperature = gr.Slider( minimum=-0, maximum=5.0, value=0.5, step=0.1, interactive=True, label="Temperature",)
75
- top_k = gr.Slider( minimum=1, maximum=50, value=4, step=1, interactive=True, label="Top-k",)
76
- repetition_penalty = gr.Slider( minimum=0.1, maximum=3.0, value=1.03, step=0.01, interactive=True, label="Repetition Penalty", )
 
77
 
78
  #b1.click(predict, [t,s], [c,s])
79
  #inputs.submit(predict, [t,s], [c,s])
 
61
  In this app, you can explore the outputs of a 20B large language model.
62
  """
63
 
64
+ with gr.Blocks(css = "#col_container {width: 700px; height: 400px; overflow: auto;}") as demo:
65
  gr.HTML(title)
66
+ with gr.Column(elem_id = "col_container"):
67
+ chatbot = gr.Chatbot(elem_id='chatbot') #c
68
+ inputs = gr.Textbox(placeholder= "Hi my name is Joe.", label= "Type an input and press Enter") #t
69
+ state = gr.State([]) #s
70
+ b1 = gr.Button()
71
+
72
+ #inputs, top_p, temperature, top_k, repetition_penalty
73
+ with gr.Accordion("Parameters", open=False):
74
+ top_p = gr.Slider( minimum=-0, maximum=1.0, value=0.95, step=0.05, interactive=True, label="Top-p (nucleus sampling)",)
75
+ temperature = gr.Slider( minimum=-0, maximum=5.0, value=0.5, step=0.1, interactive=True, label="Temperature",)
76
+ top_k = gr.Slider( minimum=1, maximum=50, value=4, step=1, interactive=True, label="Top-k",)
77
+ repetition_penalty = gr.Slider( minimum=0.1, maximum=3.0, value=1.03, step=0.01, interactive=True, label="Repetition Penalty", )
78
 
79
  #b1.click(predict, [t,s], [c,s])
80
  #inputs.submit(predict, [t,s], [c,s])