class_docstr: Base class for all models
      
class_docstr_tok: ["Base","class","for","all","models"]
code: def from_pretrained(self, save_directory: Union[str, os.PathLike]):
      if self.model_name in ["bert2bert", "xlm-roberta", "xlm"]:
          self.model = EncoderDecoderModel.from_pretrained(
              save_directory
          )
      else:
          model_path = os.path.join(save_directory, "pytorch_model.bin")
          model_load = torch.load(model_path, map_location=self.device)
          self.load_state_dict(model_load)
  
imports: import torch
  import torch.nn
  from textbox import CLM_MODELS, SEQ2SEQ_MODELS, RNN_MODELS, PLM_MODELS
  from transformers import EncoderDecoderModel
  import os
  from typing import List, Optional, Tuple, Union
  from transformers.modeling_utils import get_parameter_dtype
  from collections import OrderedDict
label_desc: Use image node_id 10 for calling the AbstractModel obj's underlying member method code with example usage: obj.from_pretrained(save_directory) without return types