diff --git a/modules/chat.py b/modules/chat.py index a19eb0e..bb7c3c6 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -229,11 +229,11 @@ def impersonate_wrapper(text, state): # Defining some variables cumulative_reply = '' eos_token = '\n' if state['stop_at_newline'] else None - prompt = generate_chat_prompt(text, state, impersonate=True) + prompt = generate_chat_prompt('', state, impersonate=True) stopping_strings = get_stopping_strings(state) - # Yield *Is typing...* - yield shared.processing_message + yield text + '...' + cumulative_reply = text for i in range(state['chat_generation_attempts']): reply = None for reply in generate_reply(f"{prompt}{' ' if len(cumulative_reply) > 0 else ''}{cumulative_reply}", state, eos_token=eos_token, stopping_strings=stopping_strings): diff --git a/server.py b/server.py index 7382ffc..6c94738 100644 --- a/server.py +++ b/server.py @@ -714,6 +714,7 @@ def create_interface(): gen_events.append(shared.gradio['Impersonate'].click( ui.gather_interface_values, [shared.gradio[k] for k in shared.input_elements], shared.gradio['interface_state']).then( + lambda x: x, shared.gradio['textbox'], shared.gradio['Chat input'], show_progress=False).then( chat.impersonate_wrapper, shared.input_params, shared.gradio['textbox'], show_progress=False) )