From ad83b1b828698a750c2603f88a5e77f1a1740d9f Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 25 Feb 2023 02:13:24 -0300 Subject: [PATCH] Clean up send_pictures extension --- extensions/send_pictures/script.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/extensions/send_pictures/script.py b/extensions/send_pictures/script.py index fe4f083d..7ee604ee 100644 --- a/extensions/send_pictures/script.py +++ b/extensions/send_pictures/script.py @@ -10,11 +10,10 @@ from modules.bot_picture import caption_image params = { } -# If 'state' is 'temporary' or 'permanent', will hijack the next -# chatbot wrapper call with a custom input text and optionally -# custom output text +# If 'state' is True, will hijack the next chat generation with +# custom input text input_hijack = { - 'state': 'off', + 'state': False, 'value': ["", ""] } @@ -57,4 +56,3 @@ def ui(): 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) picture_select.upload(eval(function_call), shared.input_params, shared.gradio['display'], show_progress=shared.args.no_stream) picture_select.upload(lambda : None, [], [picture_select], show_progress=False) - #parser.add_argument('--picture', action='store_true', help='Adds an ability to send pictures in chat UI modes. Captions are generated by BLIP.')