From 180420d2c9691eefcd8e60217b2fdb9efac1359b Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 11 Jul 2023 20:56:01 -0700 Subject: [PATCH] Fix send_pictures extension --- extensions/send_pictures/script.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/send_pictures/script.py b/extensions/send_pictures/script.py index dbbeb0fd..63421743 100644 --- a/extensions/send_pictures/script.py +++ b/extensions/send_pictures/script.py @@ -7,6 +7,7 @@ from transformers import BlipForConditionalGeneration, BlipProcessor from modules import chat, shared from modules.ui import gather_interface_values +from modules.utils import gradio # If 'state' is True, will hijack the next chat generation with # custom input text given by 'value' in the format [text, visible_text] @@ -42,6 +43,6 @@ def ui(): # Prepare the input hijack, update the interface values, call the generation function, and clear the picture picture_select.upload( lambda picture, name1, name2: input_hijack.update({"state": True, "value": generate_chat_picture(picture, name1, name2)}), [picture_select, shared.gradio['name1'], shared.gradio['name2']], None).then( - gather_interface_values, [shared.gradio[k] for k in shared.input_elements], shared.gradio['interface_state']).then( - chat.generate_chat_reply_wrapper, shared.input_params, shared.gradio['display'], show_progress=False).then( + gather_interface_values, gradio(shared.input_elements), gradio('interface_state')).then( + chat.generate_chat_reply_wrapper, shared.input_params, gradio('display', 'history'), show_progress=False).then( lambda: None, None, picture_select, show_progress=False)