mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Minor fix
This commit is contained in:
parent
0abff499e2
commit
bfb1be2820
@ -26,7 +26,7 @@ def caption_image(raw_image):
|
|||||||
def generate_chat_picture(picture, name1, name2):
|
def generate_chat_picture(picture, name1, name2):
|
||||||
text = f'*{name1} sends {name2} a picture that contains the following: "{caption_image(picture)}"*'
|
text = f'*{name1} sends {name2} a picture that contains the following: "{caption_image(picture)}"*'
|
||||||
# lower the resolution of sent images for the chat, otherwise the log size gets out of control quickly with all the base64 values in visible history
|
# lower the resolution of sent images for the chat, otherwise the log size gets out of control quickly with all the base64 values in visible history
|
||||||
image.thumbnail((300, 300))
|
picture.thumbnail((300, 300))
|
||||||
buffer = BytesIO()
|
buffer = BytesIO()
|
||||||
picture.save(buffer, format="JPEG")
|
picture.save(buffer, format="JPEG")
|
||||||
img_str = base64.b64encode(buffer.getvalue()).decode('utf-8')
|
img_str = base64.b64encode(buffer.getvalue()).decode('utf-8')
|
||||||
@ -45,4 +45,4 @@ def ui():
|
|||||||
picture_select.upload(eval(function_call), shared.input_params, shared.gradio['display'], show_progress=shared.args.no_stream)
|
picture_select.upload(eval(function_call), shared.input_params, shared.gradio['display'], show_progress=shared.args.no_stream)
|
||||||
|
|
||||||
# Clear the picture from the upload field
|
# Clear the picture from the upload field
|
||||||
picture_select.upload(lambda : None, [], [picture_select], show_progress=False)
|
picture_select.upload(lambda : None, [], [picture_select], show_progress=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user