code: def _load_from_checkpoint(self, resume_from_checkpoint):
      args = self.args
      if os.path.isfile(
          os.path.join(resume_from_checkpoint, WEIGHTS_NAME)
      ):
          logger.info(f"Loading model from {resume_from_checkpoint}).")
  
      if os.path.isfile(
          os.path.join(resume_from_checkpoint, CONFIG_NAME)
      ):
          config = PretrainedConfig.from_json_file(
              os.path.join(resume_from_checkpoint, CONFIG_NAME)
          )
          checkpoint_version = config.transformers_version
          if (
              checkpoint_version is not None
              and checkpoint_version != __version__
          ):
              logger.warn(
                  f"You are resuming training from a checkpoint trained with {checkpoint_version} of "
                  f"Transformers but your current version is {__version__}. This is not recommended and could "
                  "yield to errors or unwanted behaviors."
              )
  
      if args.deepspeed:
          # will be resumed in deepspeed_init
          pass
      else:
          adapter_loaded = False
          if os.path.isdir(resume_from_checkpoint):
              adapter_loaded = self._load_adapters(
                  resume_from_checkpoint
              )
              self._load_adapter_fusions(resume_from_checkpoint)
              # Save all heads for a model with heads
              if hasattr(self.model, "heads"):
                  self._load_heads(resume_from_checkpoint)
  
          if not adapter_loaded:
              raise Exception(
                  "Can't find a valid checkpoint at {}".format(
                      resume_from_checkpoint
                  )
              )
  
imports: import os
  import re
  from typing import Callable, Dict, List, Optional, Tuple, Union
  import torch
  from torch import nn
  from torch.utils.data.dataset import Dataset
  from transformers import PreTrainedModel, Seq2SeqTrainer, Trainer, __version__
  from transformers.configuration_utils import PretrainedConfig
  from transformers.data.data_collator import DataCollator
  from transformers.modeling_utils import unwrap_model
  from transformers.tokenization_utils_base import PreTrainedTokenizerBase
  from transformers.trainer_callback import TrainerCallback, TrainerControl, TrainerState
  from transformers.trainer_utils import EvalPrediction
  from transformers.training_args import TrainingArguments
  from transformers.utils import CONFIG_NAME, WEIGHTS_NAME, is_sagemaker_mp_enabled, logging
  from .composition import AdapterCompositionBlock, Fuse
label_desc: Use image node_id 4 for calling the AdapterTrainer obj's underlying member method code with example usage: obj._load_from_checkpoint(resume_from_checkpoint) without return types