def on_train_end(self, trainer: pl.Trainer, pl_module: pl.LightningModule) -> None:
        """Export the compressed model when training ends.

        This method handles the export of the compressed model to ONNX format and
        optionally converts it to OpenVINO IR format if the export directory is specified.

        Args:
            trainer (pl.Trainer): PyTorch Lightning trainer instance
            pl_module (pl.LightningModule): The trained Lightning module

        Note:
            - Requires OpenVINO's Model Optimizer (``mo``) to be available in the system PATH
            - Creates the export directory if it doesn't exist
            - Exports ONNX model as ``model_nncf.onnx``
            - Converts ONNX to OpenVINO IR format using ``mo``
        """
        del trainer, pl_module  # `trainer` and `pl_module` variables are not used.

        if self.export_dir is None or self.nncf_ctrl is None:
            return

        Path(self.export_dir).mkdir(parents=True, exist_ok=True)
        onnx_path = str(Path(self.export_dir) / "model_nncf.onnx")
        self.nncf_ctrl.export_model(onnx_path)

        optimize_command = ["mo", "--input_model", onnx_path, "--output_dir", self.export_dir]
        # TODO(samet-akcay): Check if mo can be done via python API
        # CVS-122665
        subprocess.run(optimize_command, check=True)  # noqa: S603  # nosec B603
Export the compressed model when training ends.

        This method handles the export of the compressed model to ONNX format and
        optionally converts it to OpenVINO IR format if the export directory is specified.

        Args:
            trainer (pl.Trainer): PyTorch Lightning trainer instance
            pl_module (pl.LightningModule): The trained Lightning module

        Note:
            - Requires OpenVINO's Model Optimizer (``mo``) to be available in the system PATH
            - Creates the export directory if it doesn't exist
            - Exports ONNX model as ``model_nncf.onnx``
            - Converts ONNX to OpenVINO IR format using ``mo``
        
src/anomalib/callbacks/nncf/callback.py