class_docstr: Base class for all models
      
class_docstr_tok: ["Base","class","for","all","models"]
code: def save_pretrained(
      self,
      save_directory: Union[str, os.PathLike],
      is_main_process: bool = True,
  ):
      # save the string version of dtype to the config, e.g. convert torch.float32 => "float32"
      # we currently don't use this setting automatically, but may start to use with v5
      dtype = get_parameter_dtype(self)
      self.configuration.torch_dtype = str(dtype).split(".")[1]
  
      # Attach architecture to the config
      self.configuration.architectures = [self.model.__class__.__name__]
  
      # Save the config
      if is_main_process:
          self.configuration.save_pretrained(save_directory)
  
      # Save the tokenizer
      if self.tokenizer is not None:
          self.tokenizer.save_pretrained(save_directory)
  
      if self.model_name in ["bert2bert", "xlm-roberta", "xlm"]:
          self.model.save_pretrained(save_directory)
      else:
          state_dict = OrderedDict(
              [
                  (k, v.detach().cpu())
                  for k, v in self.state_dict().items()
              ]
          )
          torch.save(
              state_dict,
              os.path.join(save_directory, "pytorch_model.bin"),
          )
  
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 11 for calling the AbstractModel obj's underlying member method code with example usage: obj.save_pretrained(save_directory, is_main_process) without return types