[Bugfix] Molmo text-only input bug fix (#9397)

Co-authored-by: sanghol <sanghol@allenai.org>
Co-authored-by: Roger Wang <136131678+ywang96@users.noreply.github.com>
Co-authored-by: Roger Wang <ywang@roblox.com>
This commit is contained in:
Reza Salehi 2024-10-15 21:56:09 -07:00 committed by GitHub
parent 717a5f82cd
commit ed920135c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -946,9 +946,12 @@ def pad_images(
def input_processor_for_molmo(ctx: InputContext, llm_inputs: LLMInputs):
prompt = llm_inputs["prompt"]
multi_modal_data = llm_inputs.get("multi_modal_data")
image = multi_modal_data.get("image")
prompt = llm_inputs.get("prompt", None)
multi_modal_data = llm_inputs.get("multi_modal_data", None)
if multi_modal_data is not None:
image = multi_modal_data.get("image", None)
else:
image = None
processor = cached_get_processor(ctx.model_config.model,
trust_remote_code=True,
revision=ctx.model_config.code_revision)