Janus icon indicating copy to clipboard operation
Janus copied to clipboard

怎么进行多图联合推理

Open LiLiLiam opened this issue 3 weeks ago • 3 comments

我需要在一个question中对多张图进行联合推理,以下是我的部分代码: content_images = [] for idx in range(len(image_files)): # content.append({"type": "image", "image": image_files[idx]}) content_images.append("data:image,{}".format(image_to_base64(image_files[idx], max_size=1024)))

conversation = [
    {
        "role": "<|User|>",
        "content": f"<image_placeholder>\n{query}",
        "images": content_images,
    },
    {"role": "<|Assistant|>", "content": ""},
]

目前会提示问题: RuntimeError: The expanded size of the tensor (1) must match the existing size (2) at non-singleton dimension 0. Target sizes: [1, 3, 384, 384]. Tensor sizes: [2, 3, 384, 384] 要如何改进我的代码,使其可以实现多图联合推理

LiLiLiam avatar Jan 28 '25 06:01 LiLiLiam