src/transformers/models/esm/modeling_esm.py/EsmModel/_set_gradient_checkpointing
class EsmModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, EsmEncoder):
            module.gradient_checkpointing = value