From e72a64c170e7b9677c79caa090296adcddad5d78 Mon Sep 17 00:00:00 2001 From: Shijie Lian <1225419368@qq.com> Date: Fri, 11 Jul 2025 16:22:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Fix=20handling=20of=20encode=5Fvideo=20outp?= =?UTF-8?q?ut=20in=20vllm.py=20so=20each=20frame=E2=80=99s=20Base64=20is?= =?UTF-8?q?=20sent=20correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lmms_eval/models/vllm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmms_eval/models/vllm.py b/lmms_eval/models/vllm.py index d1bedc66b..836503a25 100644 --- a/lmms_eval/models/vllm.py +++ b/lmms_eval/models/vllm.py @@ -203,7 +203,7 @@ def generate_until(self, requests) -> List[str]: messages = [{"role": "user", "content": []}] # When there is no image token in the context, append the image to the text messages[0]["content"].append({"type": "text", "text": contexts}) - for img in imgs: + for img in self.flatten(imgs): messages[0]["content"].append({"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img}"}}) batched_messages.append(messages) From 40141aa403449679a23083a70c873ed5bc7e2659 Mon Sep 17 00:00:00 2001 From: Shijie Lian <89021551+LiamLian0727@users.noreply.github.com> Date: Fri, 11 Jul 2025 17:22:27 +0800 Subject: [PATCH 2/3] Update vllm.py --- lmms_eval/models/vllm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lmms_eval/models/vllm.py b/lmms_eval/models/vllm.py index 836503a25..3c620506d 100644 --- a/lmms_eval/models/vllm.py +++ b/lmms_eval/models/vllm.py @@ -150,7 +150,9 @@ def encode_video(self, video_path): def flatten(self, input): new_list = [] for i in input: - for j in i: + if isinstance(i, (list, tuple)): + new_list.extend(i) + else: new_list.append(j) return new_list From e1bcb882bd1f2ea2d0df028c63b77be67419347d Mon Sep 17 00:00:00 2001 From: Shijie Lian <89021551+LiamLian0727@users.noreply.github.com> Date: Fri, 11 Jul 2025 17:28:36 +0800 Subject: [PATCH 3/3] Update vllm.py --- lmms_eval/models/vllm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmms_eval/models/vllm.py b/lmms_eval/models/vllm.py index 3c620506d..71b1f80f6 100644 --- a/lmms_eval/models/vllm.py +++ b/lmms_eval/models/vllm.py @@ -153,7 +153,7 @@ def flatten(self, input): if isinstance(i, (list, tuple)): new_list.extend(i) else: - new_list.append(j) + new_list.append(i) return new_list def generate_until(self, requests) -> List[str]: