class_docstr: Used to pre-train the actor model to generate better prompts.
  
  Args:
      config (ConfigActor): Configuration for the actor model
  
  Attributes:
      config (ConfigActor): Configuration for the actor model
      model (ActorModel): Actor model
      loss_function (torch.nn.CrossEntropyLoss): Loss function
      optimizer (torch.optim.Adam): Optimizer
      validation_flag (bool): Flag to indicate if the validation dataset
          is provided
      train_dataset (ActorDataset): Training dataset
      train_dataloader (DataLoader): Training dataloader
      validation_dataset (ActorDataset): Validation dataset
      validation_dataloader (DataLoader): Validation dataloader
      scheduler (torch.optim.lr_scheduler): Learning rate scheduler
      training_stats (TrainingStats): Training statistics
      model_engine (ModelEngine): Model engine for deepspeed training
      accelerator (Accelerator): Accelerator for accelerate training
  
  Methods:
      train: Train the actor model
      load_checkpoint: Load a checkpoint
      save_checkpoint: Save a checkpoint
docstr: Load a checkpoint from the model folder
  
  Returns:
      Tuple[int, int]: Current epoch and current step to resume
          training
docstr_tok: ["Load","a","checkpoint","from","the","model","folder","Returns",":","Tuple","[","int",",","int","]",":","Current","epoch","and","current","step","to","resume","training"]
code: def load_checkpoint(
      self,
  ) -> Tuple[int, int]:
      """Load a checkpoint from the model folder
  
      Returns:
          Tuple[int, int]: Current epoch and current step to resume
              training
      """
  
      print("Looking for checkpoints...")
      # look for a checkpoint
      path = ModelLoader.check_model_path(
          config=self.config,
          is_checkpoint=True,
          current_epoch=None,
      )
  
      # if there is a checkpoint
      if path is not None:
          print("Loading ...")
  
          if self.config.deepspeed_enable:
              # try to load the checkpoint
              try:
                  _, client_state = self.model_engine.load_checkpoint(
                      path
                  )
              except Exception:
                  print(
                      "Checkpoint corrupted!"
                      "Try to remove the last checkpoint."
                      "Now Starting from epoch 0, step 0"
                  )
                  return 0, 0
              # load epoch and step to resume loops
              epoch = client_state["epoch"]
              step = client_state["step"]
          else:
              # try to load the checkpoint
              try:
                  checkpoint = torch.load(path)
              except Exception:
                  print(
                      "Checkpoint corrupted!"
                      "Try to remove the last checkpoint."
                      "Now Starting from epoch 0, step 0"
                  )
                  return 0, 0
  
              # assing the checkpoint to the model
              epoch = checkpoint["epoch"]
              self.actor.model.load_state_dict(checkpoint["state_dict"])
              self.optimizer.load_state_dict(
                  checkpoint["optim_state_dict"]
              )
              self.trainign_stats = checkpoint["training_stats"]
              step = checkpoint["step"]
              return epoch, step + 1  # return the next episode to train
      return 0, 0
  
imports: import json
  import yaml
  import os
  import shutil
  import deepspeed
  import torch
  from accelerate import Accelerator
  from beartype import beartype
  from beartype.typing import Tuple
  from einops import rearrange
  from peft import get_peft_model, LoraConfig, TaskType
  from torch.utils.data import DataLoader, Dataset
  from transformers import AutoModelForCausalLM, AutoTokenizer
  from chatllama.rlhf.config import ConfigActor
  from chatllama.rlhf.model_list import hf_models_causal_lm, llama_models, hf_models
  from chatllama.rlhf.model_loader import ModelLoader
  from chatllama.rlhf.utils import TrainingStats
label_desc: Use image node_id 3 for calling the ActorTrainer obj's underlying member method code with example usage: obj.load_checkpoint() and returns: int,  int, epoch,  unknown, int,  int, int,  int