Update backupapp.py
Browse files- backupapp.py +3 -2
backupapp.py
CHANGED
|
@@ -111,7 +111,7 @@ description = """
|
|
| 111 |
"""
|
| 112 |
|
| 113 |
# 6. Use Gradio to pull it all together
|
| 114 |
-
with gr.Blocks(css = """#col_container {width:
|
| 115 |
gr.HTML(title)
|
| 116 |
with gr.Column(elem_id = "col_container"):
|
| 117 |
inputs = gr.Textbox(placeholder= "Hi there!", label= "Type an input and press Enter")
|
|
@@ -121,11 +121,12 @@ with gr.Blocks(css = """#col_container {width: 1000px; margin-left: auto; margin
|
|
| 121 |
with gr.Accordion("Parameters", open=False):
|
| 122 |
top_p = gr.Slider( minimum=-0, maximum=1.0, value=1.0, step=0.05, interactive=True, label="Top-p (nucleus sampling)",)
|
| 123 |
temperature = gr.Slider( minimum=-0, maximum=5.0, value=1.0, step=0.1, interactive=True, label="Temperature",)
|
| 124 |
-
chat_counter = gr.Number(value=0, visible=
|
| 125 |
|
| 126 |
inputs.submit(predict, [inputs, top_p, temperature,chat_counter, chatbot, state], [chatbot, state, chat_counter])
|
| 127 |
b1.click(predict, [inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter])
|
| 128 |
b1.click(reset_textbox, [], [inputs])
|
| 129 |
inputs.submit(reset_textbox, [], [inputs])
|
| 130 |
gr.Markdown(description)
|
|
|
|
| 131 |
demo.queue().launch(debug=True)
|
|
|
|
| 111 |
"""
|
| 112 |
|
| 113 |
# 6. Use Gradio to pull it all together
|
| 114 |
+
with gr.Blocks(css = """#col_container {width: 1400px; margin-left: auto; margin-right: auto;} #chatbot {height: 600px; overflow: auto;}""") as demo:
|
| 115 |
gr.HTML(title)
|
| 116 |
with gr.Column(elem_id = "col_container"):
|
| 117 |
inputs = gr.Textbox(placeholder= "Hi there!", label= "Type an input and press Enter")
|
|
|
|
| 121 |
with gr.Accordion("Parameters", open=False):
|
| 122 |
top_p = gr.Slider( minimum=-0, maximum=1.0, value=1.0, step=0.05, interactive=True, label="Top-p (nucleus sampling)",)
|
| 123 |
temperature = gr.Slider( minimum=-0, maximum=5.0, value=1.0, step=0.1, interactive=True, label="Temperature",)
|
| 124 |
+
chat_counter = gr.Number(value=0, visible=True, precision=0)
|
| 125 |
|
| 126 |
inputs.submit(predict, [inputs, top_p, temperature,chat_counter, chatbot, state], [chatbot, state, chat_counter])
|
| 127 |
b1.click(predict, [inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter])
|
| 128 |
b1.click(reset_textbox, [], [inputs])
|
| 129 |
inputs.submit(reset_textbox, [], [inputs])
|
| 130 |
gr.Markdown(description)
|
| 131 |
+
|
| 132 |
demo.queue().launch(debug=True)
|