Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -114,17 +114,17 @@ description = """
|
|
114 |
with gr.Blocks(css = """#col_container {width: 1000px; margin-left: auto; margin-right: auto;} #chatbot {height: 520px; overflow: auto;}""") as demo:
|
115 |
gr.HTML(title)
|
116 |
with gr.Column(elem_id = "col_container"):
|
117 |
-
|
118 |
-
|
119 |
-
state = gr.State([])
|
120 |
b1 = gr.Button()
|
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=False, 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)
|
|
|
114 |
with gr.Blocks(css = """#col_container {width: 1000px; margin-left: auto; margin-right: auto;} #chatbot {height: 520px; 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")
|
118 |
+
chatbot = gr.Chatbot(elem_id='chatbot')
|
119 |
+
state = gr.State([])
|
120 |
b1 = gr.Button()
|
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=False, 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)
|