From 5b60674e8f5315b8ae188221f60a6d6873b25dec Mon Sep 17 00:00:00 2001 From: Deyao Zhu Date: Fri, 13 Oct 2023 15:53:08 +0300 Subject: [PATCH] fix the bug in conversation template --- demo_v2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demo_v2.py b/demo_v2.py index 52fb897..4dc8ff5 100644 --- a/demo_v2.py +++ b/demo_v2.py @@ -12,6 +12,7 @@ import torch import html import gradio as gr +import torchvision.transforms as T import torch.backends.cudnn as cudnn from minigpt4.common.config import Config @@ -73,7 +74,7 @@ CONV_VISION = Conversation( messages=[], offset=2, sep_style=SeparatorStyle.SINGLE, - sep="", + sep="", ) @@ -474,7 +475,7 @@ def gradio_answer(chatbot, chat_state, img_list, temperature): def gradio_stream_answer(chatbot, chat_state, img_list, temperature): - print('chat state', chat_state) + print('chat state', chat_state.get_prompt()) if not isinstance(img_list[0], torch.Tensor): chat.encode_img(img_list) streamer = chat.stream_answer(conv=chat_state,