From 03f093f4be09db7a1c035619783b9e6a460d7d0c Mon Sep 17 00:00:00 2001 From: patrick-tssn Date: Fri, 17 May 2024 21:07:34 +0800 Subject: [PATCH] fix bug for demo --- tasks/eval/eval_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/eval/eval_utils.py b/tasks/eval/eval_utils.py index 3aabad1..c7d8db8 100644 --- a/tasks/eval/eval_utils.py +++ b/tasks/eval/eval_utils.py @@ -429,7 +429,7 @@ def answer(self, conv: Conversation, img_list, max_new_tokens=200, num_beams=1, split_tag = "<|im_start|> assistant\n" else: split_tag = conv.roles[-1] - output_text = output_text.split(split_tag)[-1].rstrip(conv.sep[1]) + output_text = output_text.split(split_tag)[-1].split(conv.sep[1])[0] conv.assistant_response(output_text) return output_text, output_token.cpu().numpy(), conv