code: def load_checkpoint(
      model, checkpoint_path, use_cuda=False, eval=False
  ):
      try:
          state = torch.load(
              checkpoint_path, map_location=torch.device("cpu")
          )
      except ModuleNotFoundError:
          pickle_tts.Unpickler = RenamingUnpickler
          state = torch.load(
              checkpoint_path,
              map_location=torch.device("cpu"),
              pickle_module=pickle_tts,
          )
      model.load_state_dict(state["model"])
      if use_cuda:
          model.cuda()
      if eval:
          model.eval()
      return model, state
  
file_path: TTS/TTS/vocoder/utils/io.py
imports: import os
  import torch
  import datetime
  import pickle
  from TTS.utils.io import RenamingUnpickler
label_desc: Use image node_id 1 for calling a global function with example usage: load_checkpoint(model, checkpoint_path, use_cuda, eval) and returns: model,  state