mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Fix send_pictures extension
This commit is contained in:
parent
d986c17c52
commit
180420d2c9
@ -7,6 +7,7 @@ from transformers import BlipForConditionalGeneration, BlipProcessor
|
|||||||
|
|
||||||
from modules import chat, shared
|
from modules import chat, shared
|
||||||
from modules.ui import gather_interface_values
|
from modules.ui import gather_interface_values
|
||||||
|
from modules.utils import gradio
|
||||||
|
|
||||||
# If 'state' is True, will hijack the next chat generation with
|
# If 'state' is True, will hijack the next chat generation with
|
||||||
# custom input text given by 'value' in the format [text, visible_text]
|
# 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
|
# Prepare the input hijack, update the interface values, call the generation function, and clear the picture
|
||||||
picture_select.upload(
|
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(
|
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(
|
gather_interface_values, gradio(shared.input_elements), gradio('interface_state')).then(
|
||||||
chat.generate_chat_reply_wrapper, shared.input_params, shared.gradio['display'], show_progress=False).then(
|
chat.generate_chat_reply_wrapper, shared.input_params, gradio('display', 'history'), show_progress=False).then(
|
||||||
lambda: None, None, picture_select, show_progress=False)
|
lambda: None, None, picture_select, show_progress=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user