code: def save(self, filename):
      params = {
          "model": self.model.state_dict()
          if self.model is not None
          else None,
          "vocab": self.vocab.state_dict(),
          "lexicon": self.lexicon,
          "config": self.args,
      }
      try:
          torch.save(
              params, filename, _use_new_zipfile_serialization=False
          )
          logger.info("Model saved to {}".format(filename))
      except BaseException:
          logger.warning("Saving failed... continuing anyway.")
  
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 4 for calling the Trainer obj's underlying member method code with example usage: obj.save(filename) without return types