def predict(self, image_path: str | Path, prompt: Prompt) -> str:
        """Predict whether an image contains anomalies.

        Args:
            image_path (str | Path): Path to the image to analyze
            prompt (Prompt): Prompt object containing few-shot and prediction prompts

        Returns:
            str: Model's prediction response
        """
        image = Image.open(image_path)
        messages: list[dict] = []

        if len(self._ref_images) > 0:
            messages.append(self._generate_message(content=prompt.few_shot, images=self._ref_images))

        messages.append(self._generate_message(content=prompt.predict, images=[image]))
        processed_prompt = [self.processor.apply_chat_template(messages, add_generation_prompt=True)]

        images = [*self._ref_images, image]
        inputs = self.processor(images, processed_prompt, return_tensors="pt", padding=True).to(self.model.device)
        outputs = self.model.generate(**inputs, max_new_tokens=100)
        return self.processor.decode(outputs[0], skip_special_tokens=True)
Predict whether an image contains anomalies.

        Args:
            image_path (str | Path): Path to the image to analyze
            prompt (Prompt): Prompt object containing few-shot and prediction prompts

        Returns:
            str: Model's prediction response
        
src/anomalib/models/image/vlm_ad/backends/huggingface.py