From 4745ca8e0834f5f6acf4501ea8deb715805497c0 Mon Sep 17 00:00:00 2001 From: GIO PAIK Date: Fri, 26 Jul 2024 10:33:46 +0900 Subject: [PATCH] Fix: Handle None value for model_specific_kwargs in `seed_doc_to_text()` --- lmms_eval/tasks/seedbench_2/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lmms_eval/tasks/seedbench_2/utils.py b/lmms_eval/tasks/seedbench_2/utils.py index f88ded9c..15c6ef37 100755 --- a/lmms_eval/tasks/seedbench_2/utils.py +++ b/lmms_eval/tasks/seedbench_2/utils.py @@ -13,6 +13,8 @@ def parse_choice_img(choice: str, img_token: str): def seed_doc_to_text(doc, model_specific_kwargs=None): question = doc["question"] + if model_specific_kwargs is None: + return question question.replace("", model_specific_kwargs["img_token"]) question += "\n" + f"A. {parse_choice_img(doc['choice_a'], model_specific_kwargs['img_token'])}\n" question += f"B. {parse_choice_img(doc['choice_b'], model_specific_kwargs['img_token'])}\n"