docstr: Load the model along with any other saved state for training
  
  Note that you MUST set finetune=True if planning to continue training
  Otherwise the only benefit you will get will be a warm GPU
docstr_tok: ["Load","the","model","along","with","any","other","saved","state","for","training","Note","that","you","MUST","set","finetune=True","if","planning","to","continue","training","Otherwise","the","only","benefit","you","will","get","will","be","a","warm","GPU"]
code: def load(cls, args, filename, finetune=False):
      """
      Load the model along with any other saved state for training
  
      Note that you MUST set finetune=True if planning to continue training
      Otherwise the only benefit you will get will be a warm GPU
      """
      state = torch.load(filename, lambda storage, loc: storage)
      model = CharacterLanguageModel.from_full_state(
          state["model"], finetune
      )
      model = model.to(args["device"])
  
      params = [
          param for param in model.parameters() if param.requires_grad
      ]
      optimizer = torch.optim.SGD(
          params,
          lr=args["lr0"],
          momentum=args["momentum"],
          weight_decay=args["weight_decay"],
      )
      if "optimizer" in state:
          optimizer.load_state_dict(state["optimizer"])
  
      criterion = torch.nn.CrossEntropyLoss()
      if "criterion" in state:
          criterion.load_state_dict(state["criterion"])
  
      scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(
          optimizer,
          verbose=True,
          factor=args["anneal"],
          patience=args["patience"],
      )
      if "scheduler" in state:
          scheduler.load_state_dict(state["scheduler"])
  
      epoch = state.get("epoch", 1)
      global_step = state.get("global_step", 0)
      return cls(
          model,
          params,
          optimizer,
          criterion,
          scheduler,
          epoch,
          global_step,
      )
  
imports: from collections import Counter
  from operator import itemgetter
  import os
  import torch
  import torch.nn
  from torch.nn.utils.rnn import pack_sequence, pad_packed_sequence, pack_padded_sequence, PackedSequence
  from stanza.models.common.data import get_long_tensor
  from stanza.models.common.packed_lstm import PackedLSTM
  from stanza.models.common.utils import open_read_text, tensor_unsort, unsort
  from stanza.models.common.dropout import SequenceUnitDropout
  from stanza.models.common.vocab import UNK_ID, CharVocab
label_desc: Use image node_id 4 for calling the CharacterLanguageModelTrainer obj's underlying member method code with example usage: obj.load(cls, args, filename, finetune) and returns: cls