code: def load(self, filename):
      try:
          checkpoint = torch.load(
              filename, lambda storage, loc: storage
          )
      except BaseException:
          logger.error("Cannot load model from {}".format(filename))
          raise
      self.args = checkpoint["config"]
      if self.args.get("use_mwt", None) is None:
          # Default to True as many currently saved models
          # were built with mwt layers
          self.args["use_mwt"] = True
      self.model = Tokenizer(
          self.args,
          self.args["vocab_size"],
          self.args["emb_dim"],
          self.args["hidden_dim"],
          dropout=self.args["dropout"],
          feat_dropout=self.args["feat_dropout"],
      )
      self.model.load_state_dict(checkpoint["model"])
      self.vocab = Vocab.load_state_dict(checkpoint["vocab"])
      self.lexicon = checkpoint["lexicon"]
  
      if self.lexicon is not None:
          self.dictionary = create_dictionary(self.lexicon)
      else:
          self.dictionary = None
  
file_path: stanza/stanza/models/tokenization/trainer.py
imports: import sys
  import logging
  import torch
  import torch.nn
  import torch.optim
  from stanza.models.common import utils
  from stanza.models.common.trainer import Trainer
  from stanza.models.tokenization.utils import create_dictionary
  from .model import Tokenizer
  from .vocab import Vocab
label_desc: Use image node_id 5 for calling the Trainer obj's underlying member method code with example usage: obj.load(filename) without return types