def model(self) -> AnomalibModule:
        """Property to get the model.

        Raises:
            UnassignedError: When the model is not assigned yet.

        Returns:
            AnomalibModule: Anomaly model.
        """
        if not self.trainer.lightning_module:
            msg = "Trainer does not have a model assigned yet."
            raise UnassignedError(msg)
        return self.trainer.lightning_module
Property to get the model.

        Raises:
            UnassignedError: When the model is not assigned yet.

        Returns:
            AnomalibModule: Anomaly model.
        
src/anomalib/engine/engine.py