def validation_step(self, batch: ImageBatch, *args, **kwargs) -> ImageBatch:
        """Perform validation step.

        Args:
            batch (ImageBatch): Batch of images to validate.
            *args: Variable length argument list.
            **kwargs: Arbitrary keyword arguments.

        Returns:
            ImageBatch: Batch with predictions and explanations added.
        """
        del args, kwargs  # These variables are not used.
        assert batch.image_path is not None
        responses = [(self.vlm_backend.predict(img_path, self.prompt)) for img_path in batch.image_path]
        batch.explanation = responses
        batch.pred_label = torch.tensor([1.0 if r.startswith("Y") else 0.0 for r in responses], device=self.device)
        return batch
Perform validation step.

        Args:
            batch (ImageBatch): Batch of images to validate.
            *args: Variable length argument list.
            **kwargs: Arbitrary keyword arguments.

        Returns:
            ImageBatch: Batch with predictions and explanations added.
        
src/anomalib/models/image/vlm_ad/lightning_model.py