[Bugfix] Fix Mllama interleaved images input support (#15564)

Signed-off-by: Isotr0py <2037008807@qq.com>
Co-authored-by: Chen Zhang <zhangch99@outlook.com>
This commit is contained in:
Isotr0py
2025-03-30 02:11:15 +08:00
committed by GitHub
parent 2bc4be4e32
commit 3c0ff914ac
2 changed files with 52 additions and 17 deletions

View File

@@ -229,8 +229,8 @@ def load_mllama(question: str, image_urls: list[str]) -> ModelRequestData:
limit_mm_per_prompt={"image": len(image_urls)},
)
placeholders = "<|image|>" * len(image_urls)
prompt = f"{placeholders}<|begin_of_text|>{question}"
img_prompt = "Given the first image <|image|> and the second image<|image|>"
prompt = f"<|begin_of_text|>{img_prompt}, {question}?"
return ModelRequestData(
engine_args=engine_args,
prompt=prompt,