diff --git a/modules/chat.py b/modules/chat.py index 4c2a8ced..9290dd62 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -1918,10 +1918,16 @@ def handle_send_instruction_click(state): output = generate_chat_prompt("Input", state) - return output + if state["show_two_notebook_columns"]: + return gr.update(), output, "" + else: + return output, gr.update(), gr.update() def handle_send_chat_click(state): output = generate_chat_prompt("", state, _continue=True) - return output, output, "" + if state["show_two_notebook_columns"]: + return gr.update(), output, "" + else: + return output, gr.update(), gr.update() diff --git a/modules/ui_chat.py b/modules/ui_chat.py index 588ea3d6..8a90608f 100644 --- a/modules/ui_chat.py +++ b/modules/ui_chat.py @@ -344,7 +344,7 @@ def create_event_handlers(): shared.gradio['send_instruction_to_notebook'].click( ui.gather_interface_values, gradio(shared.input_elements), gradio('interface_state')).then( - chat.handle_send_instruction_click, gradio('interface_state'), gradio('textbox-notebook'), show_progress=False).then( + chat.handle_send_instruction_click, gradio('interface_state'), gradio('textbox-notebook', 'textbox-default', 'output_textbox'), show_progress=False).then( None, None, None, js=f'() => {{{ui.switch_tabs_js}; switch_to_notebook()}}') shared.gradio['send-chat-to-notebook'].click(