class_docstr: Stores a constituency model and its optimizer
class_docstr_tok: ["Stores","a","constituency","model","and","its","optimizer"]
code: def load_pretrain(args, foundation_cache):
      if args.wordvec_pretrain_file:
          pretrain_file = args.wordvec_pretrain_file
      elif args.wordvec_type:
          pretrain_file = "{}/{}.{}.pretrain.pt".format(
              args.save_dir,
              args.shorthand,
              args.wordvec_type.name.lower(),
          )
      else:
          raise RuntimeError(
              "TODO: need to get the wv type back from get_wordvec_file"
          )
  
      logger.debug(
          "Looking for pretrained vectors in {}".format(pretrain_file)
      )
      if os.path.exists(pretrain_file):
          return load_pretrain(pretrain_file, foundation_cache)
      elif args.wordvec_raw_file:
          vec_file = args.wordvec_raw_file
          logger.debug(
              "Pretrain not found.  Looking in {}".format(vec_file)
          )
      else:
          vec_file = utils.get_wordvec_file(
              args.wordvec_dir,
              args.shorthand,
              args.wordvec_type.name.lower(),
          )
          logger.debug(
              "Pretrain not found.  Looking in {}".format(vec_file)
          )
      pretrain = Pretrain(
          pretrain_file, vec_file, args.pretrain_max_vocab
      )
      logger.debug("Embedding shape: %s" % str(pretrain.emb.shape))
      return pretrain
  
file_path: stanza/stanza/models/classifiers/trainer.py
imports: import logging
  import os
  import torch
  import torch.optim
  import stanza.models.classifiers.data
  import stanza.models.classifiers.cnn_classifier
  import stanza.models.classifiers.constituency_classifier
  from stanza.models.classifiers.utils import ModelType
  from stanza.models.common.foundation_cache import load_bert, load_charlm, load_pretrain
  from stanza.models.common.pretrain import Pretrain
  from stanza.models.constituency.tree_embedding import TreeEmbedding
label_desc: Use image node_id 4 for calling the Trainer obj's underlying member method code with example usage: obj.load_pretrain(args, foundation_cache) and returns: pretrain, load_pretrain