class_docstr: Base class shared by Tacotron and Tacotron2
docstr: Load model checkpoint and set up internals.
  
  Args:
      config (Coqpi): model configuration.
      checkpoint_path (str): path to checkpoint file.
      eval (bool, optional): whether to load model for evaluation.
      cache (bool, optional): If True, cache the file locally for subsequent calls. It is cached under `get_user_data_dir()/tts_cache`. Defaults to False.
docstr_tok: ["Load","model","checkpoint","and","set","up","internals",".","Args",":","config","(","Coqpi",")",":","model","configuration",".","checkpoint_path","(","str",")",":","path","to","checkpoint","file",".","eval","(","bool",",","optional",")",":","whether","to","load","model","for","evaluation",".","cache","(","bool",",","optional",")",":","If","True",",","cache","the","file","locally","for","subsequent","calls",".","It","is","cached","under","`","get_user_data_dir","(",")","\/tts_cache","`",".","Defaults","to","False","."]
code: def load_checkpoint(
      self, config, checkpoint_path, eval=False, cache=False
  ):  # pylint: disable=unused-argument, redefined-builtin
      """Load model checkpoint and set up internals.
  
      Args:
          config (Coqpi): model configuration.
          checkpoint_path (str): path to checkpoint file.
          eval (bool, optional): whether to load model for evaluation.
          cache (bool, optional): If True, cache the file locally for subsequent calls. It is cached under `get_user_data_dir()/tts_cache`. Defaults to False.
      """
      state = load_fsspec(
          checkpoint_path, map_location=torch.device("cpu"), cache=cache
      )
      self.load_state_dict(state["model"])
      # TODO: set r in run-time by taking it from the new config
      if "r" in state:
          # set r from the state (for compatibility with older checkpoints)
          self.decoder.set_r(state["r"])
      elif "config" in state:
          # set r from config used at training time (for inference)
          self.decoder.set_r(state["config"]["r"])
      else:
          # set r from the new config (for new-models)
          self.decoder.set_r(config.r)
      if eval:
          self.eval()
          print(
              f" > Model's reduction rate `r` is set to: {self.decoder.r}"
          )
          assert not self.training
  
imports: import copy
  from abc import abstractmethod
  from typing import Dict, Tuple
  import torch
  from coqpit import Coqpit
  from torch import nn
  from TTS.tts.layers.losses import TacotronLoss
  from TTS.tts.models.base_tts import BaseTTS
  from TTS.tts.utils.helpers import sequence_mask
  from TTS.tts.utils.speakers import SpeakerManager
  from TTS.tts.utils.synthesis import synthesis
  from TTS.tts.utils.text.tokenizer import TTSTokenizer
  from TTS.tts.utils.visual import plot_alignment, plot_spectrogram
  from TTS.utils.generic_utils import format_aux_input
  from TTS.utils.io import load_fsspec
  from TTS.utils.training import gradual_training_scheduler
label_desc: Use image node_id 7 for calling the BaseTacotron obj's underlying member method code with example usage: obj.load_checkpoint(config, checkpoint_path, eval, cache) without return types