def with_target_generator(self) -> bool:
        """Check if the model has a target_generator module."""
        return hasattr(
            self, 'target_generator') and self.target_generator is not None
Check if the model has a target_generator module.
mmpretrain/models/selfsup/base.py