From b178422d430fe05c16e1668220270f6215a0c866 Mon Sep 17 00:00:00 2001 From: ermu2001 Date: Tue, 7 May 2024 07:58:30 +0800 Subject: [PATCH] strip space in response --- tasks/eval/model_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/eval/model_utils.py b/tasks/eval/model_utils.py index b490d86..f1a700f 100644 --- a/tasks/eval/model_utils.py +++ b/tasks/eval/model_utils.py @@ -167,7 +167,7 @@ def pllava_answer(conv: Conversation, model, processor, img_list, do_sample=True split_tag = conv.roles[-1] output_text = output_text.split(split_tag)[-1] ending = conv.sep if isinstance(conv.sep, str) else conv.sep[1] - output_text = output_text.removesuffix(ending) + output_text = output_text.removesuffix(ending).strip() conv.messages[-1][1] = output_text return output_text, conv