def _prepare_messages(
        self, messages: ChatMessage, image_documents: ImageDocument
    ) -> Dict[str, Any]:
        """
        Prepares the input messages and images for PaliGemma models. Images are appended in a custom format.
        """
        if isinstance(image_documents, list):
            print(
                f"{self.model_name} can handleo only one image. Will continue with the first image."
            )
            image_documents = image_documents[0]
        images = Image.open(image_documents.image_path)
        inputs = self._processor(text=messages, images=images, return_tensors="pt").to(
            self.device
        )
        input_len = inputs["input_ids"].shape[-1]
        return {"inputs": inputs, "input_len": input_len}

        Prepares the input messages and images for PaliGemma models. Images are appended in a custom format.
        
llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-huggingface/llama_index/multi_modal_llms/huggingface/base.py