From b54e6c403ab013b0e1ce3dced1f3f05134022b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E4=BB=8E=E6=AD=A6?= Date: Tue, 5 Nov 2024 15:05:36 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]Start=20Failed=20with=20param=20--limit?= =?UTF-8?q?-mm-per-prompt=20image=3DN=20for=20Molmo=20=E5=BD=93=E5=90=AF?= =?UTF-8?q?=E5=8A=A8molmo=E6=A8=A1=E5=9E=8B=E6=97=B6=E5=80=99=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E5=B8=A6=E4=B8=8A=20--limit-mm-per-prompt=20image=3DN?= =?UTF-8?q?=20=E5=8F=82=E6=95=B0=20vllm=E5=90=AF=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=E5=9C=A8dummy=5Fdata=5Ffor=5Fprofiling=E9=87=8C=E7=9A=84assert?= =?UTF-8?q?=20num=5Fitems=20>=3D=20num=5Fexpected=20=E4=BC=9A=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=20=E5=9B=A0=E4=B8=BAmolmo=E6=A8=A1=E5=9E=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=9A=84=E8=BE=93=E5=85=A5=E5=92=8C=E4=B8=80=E8=88=AC?= =?UTF-8?q?=E5=A4=9A=E6=A8=A1=E6=80=81=E4=B8=8D=E4=B8=80=E8=87=B4=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=E5=8F=AF=E8=A7=81molmo.py=20dummy=5Fdata=5Ffor=5Fmolm?= =?UTF-8?q?o=E6=96=B9=E6=B3=95=20=E8=BF=99=E4=B8=AA=E6=94=B9=E8=BF=9B?= =?UTF-8?q?=E5=AF=B9=E4=BA=8E=E8=BE=93=E5=85=A5=E5=9B=BE=E7=89=87=E4=B8=AA?= =?UTF-8?q?=E6=95=B0=E5=81=9A=E5=87=BA=E6=AD=A3=E7=A1=AE=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vllm/inputs/registry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vllm/inputs/registry.py b/vllm/inputs/registry.py index 7d7a797be4f60..7f327c858fee7 100644 --- a/vllm/inputs/registry.py +++ b/vllm/inputs/registry.py @@ -244,6 +244,10 @@ def dummy_data_for_profiling( if dummy_data.multi_modal_data is not None: for k, v in dummy_data.multi_modal_data.items(): num_items = len(v) if isinstance(v, list) else 1 + #fix for molmo + if k == "image" and model_config.hf_config.model_type == "molmo": + if isinstance(v, dict) and "images" in v: + num_items = len(v["images"]) num_expected = mm_counts[k] assert num_items >= num_expected, ( f"Expected at least {num_expected} dummy '{k}' instances "