Skip to content

Commit d57a874

Browse files
mrsalehisangho-visionywang96
authored andcommitted
[Bugfix] Molmo text-only input bug fix (vllm-project#9397)
Co-authored-by: sanghol <[email protected]> Co-authored-by: Roger Wang <[email protected]> Co-authored-by: Roger Wang <[email protected]> Signed-off-by: LeiWang1999 <[email protected]>
1 parent ff411c9 commit d57a874

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

vllm/model_executor/models/molmo.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -946,9 +946,12 @@ def pad_images(
946946

947947

948948
def input_processor_for_molmo(ctx: InputContext, llm_inputs: LLMInputs):
949-
prompt = llm_inputs["prompt"]
950-
multi_modal_data = llm_inputs.get("multi_modal_data")
951-
image = multi_modal_data.get("image")
949+
prompt = llm_inputs.get("prompt", None)
950+
multi_modal_data = llm_inputs.get("multi_modal_data", None)
951+
if multi_modal_data is not None:
952+
image = multi_modal_data.get("image", None)
953+
else:
954+
image = None
952955
processor = cached_get_processor(ctx.model_config.model,
953956
trust_remote_code=True,
954957
revision=ctx.model_config.code_revision)

0 commit comments

Comments
 (0)