Add chat state to reset button
Browse files
app.py
CHANGED
|
@@ -56,7 +56,7 @@ class ChatBotCheese:
|
|
| 56 |
|
| 57 |
def reset(self):
|
| 58 |
self.curr_image = None
|
| 59 |
-
return [], []
|
| 60 |
|
| 61 |
def main(self):
|
| 62 |
with gr.Blocks(css="#chatbot {height:600px; overflow-y:auto;}") as demo:
|
|
@@ -106,7 +106,7 @@ class ChatBotCheese:
|
|
| 106 |
txt.submit(self.chat, [txt, gr_state, gr_ret_scale_factor, gr_num_ims, gr_num_words, gr_temp, gr_chat_state], [gr_state, chatbot, gr_chat_state])
|
| 107 |
txt.submit(lambda :"", None, txt)
|
| 108 |
btn.upload(self.add_image, [gr_state, btn], [gr_state, chatbot])
|
| 109 |
-
reset_btn.click(self.reset, [], [gr_state, chatbot])
|
| 110 |
|
| 111 |
# chatbot.change(fn = upload_button_config, outputs=btn_upload)
|
| 112 |
# text_in.submit(None, [], [], _js = "() => document.getElementById('#chatbot-component').scrollTop = document.getElementById('#chatbot-component').scrollHeight")
|
|
|
|
| 56 |
|
| 57 |
def reset(self):
|
| 58 |
self.curr_image = None
|
| 59 |
+
return [], [], []
|
| 60 |
|
| 61 |
def main(self):
|
| 62 |
with gr.Blocks(css="#chatbot {height:600px; overflow-y:auto;}") as demo:
|
|
|
|
| 106 |
txt.submit(self.chat, [txt, gr_state, gr_ret_scale_factor, gr_num_ims, gr_num_words, gr_temp, gr_chat_state], [gr_state, chatbot, gr_chat_state])
|
| 107 |
txt.submit(lambda :"", None, txt)
|
| 108 |
btn.upload(self.add_image, [gr_state, btn], [gr_state, chatbot])
|
| 109 |
+
reset_btn.click(self.reset, [], [gr_state, chatbot, gr_chat_state])
|
| 110 |
|
| 111 |
# chatbot.change(fn = upload_button_config, outputs=btn_upload)
|
| 112 |
# text_in.submit(None, [], [], _js = "() => document.getElementById('#chatbot-component').scrollTop = document.getElementById('#chatbot-component').scrollHeight")
|