docstr: Casual models:
  cpm: [src, <sep>; tgt, <sep>]
  ctrl, openai-gpt: [src, </s>; tgt, </s>]
  gpt2, gpt_neo: [src, <|endoftext|>; tgt, <|endoftext|>]
  opt: [</s>, src, </s>; tgt, </s>]
  
  Encoder-decoder models:
  bart, led, mvp: [<s>, src, </s>], [<s>, tgt, </s>], decoder_start_token_id: </s>, forced_bos_token_id: <s>
  bert2bert: [[CLS], src, [SEP]], [tgt, [SEP]], decoder_start_token_id: [CLS]
  bigbird_pegasus: [src, </s>], [tgt, </s>], decoder_start_token_id: <s>
  blenderbot: [src, </s>], [tgt, </s>], decoder_start_token_id: <s>
  blenderbot-small: [src, __end__], [tgt, __end__], decoder_start_token_id: __start__
  m2m_100: [src_lang_id, src, </s>], [tgt_lang_id, tgt, </s>], decoder_start_token_id: </s>, forced_bos_token_id: tgt_lang_id
  mbart: [src, </s>, src_lang_id], [tgt, </s>, tgt_lang_id], decoder_start_token_id: tgt_lang_id
  pegasus, pegasus_x: [src, </s>], [tgt, </s>], decoder_start_token_id: <pad>
  prophetnet: [src, [SEP]], [tgt, [SEP]], decoder_start_token_id: [SEP]
  t5, mt5: [src, </s>], [tgt, </s>], decoder_start_token_id: <pad>
  LongT5: [src, </s>], [tgt, </s>], decoder_start_token_id: <pad>
  marian: [src, </s>], [tgt, </s>], decoder_start_token_id: </s>
  xlm-roberta: [<s>, src, </s>; </s>, tgt, </s>], decoder_start_token_id: </s>
  xlm-prophetnet: [src, [SEP]], [tgt, [SEP]], decoder_start_token_id: [SEP]
  nllb: [src_lang_id, src, </s>], [tgt_lang_id, tgt, </s>], decoder_start_token_id: </s>
  unilm: [[CLS], src, [SEP]], [tgt, [SEP]], decoder_start_token_id: [SEP]
  mass: [src, [SEP]], [tgt, [SEP]], decoder_start_token_id: [SEP]
docstr_tok: ["Casual","models",":","cpm",":","[","src",",","<","sep",">",";","tgt",",","<","sep",">","]","ctrl",",","openai-gpt",":","[","src",",","<","\/s",">",";","tgt",",","<","\/s",">","]","gpt2",",","gpt_neo",":","[","src",",","<","|endoftext|",">",";","tgt",",","<","|endoftext|",">","]","opt",":","[","<","\/s",">",",","src",",","<","\/s",">",";","tgt",",","<","\/s",">","]","Encoder-decoder","models",":","bart",",","led",",","mvp",":","[","<","s",">",",","src",",","<","\/s",">","]",",","[","<","s",">",",","tgt",",","<","\/s",">","]",",","decoder_start_token_id",":","<","\/s",">",",","forced_bos_token_id",":","<","s",">","bert2bert",":","[","[","CLS","]",",","src",",","[","SEP","]","]",",","[","tgt",",","[","SEP","]","]",",","decoder_start_token_id",":","[","CLS","]","bigbird_pegasus",":","[","src",",","<","\/s",">","]",",","[","tgt",",","<","\/s",">","]",",","decoder_start_token_id",":","<","s",">","blenderbot",":","[","src",",","<","\/s",">","]",",","[","tgt",",","<","\/s",">","]",",","decoder_start_token_id",":","<","s",">","blenderbot-small",":","[","src",",","__end__","]",",","[","tgt",",","__end__","]",",","decoder_start_token_id",":","__start__","m2m_100",":","[","src_lang_id",",","src",",","<","\/s",">","]",",","[","tgt_lang_id",",","tgt",",","<","\/s",">","]",",","decoder_start_token_id",":","<","\/s",">",",","forced_bos_token_id",":","tgt_lang_id","mbart",":","[","src",",","<","\/s",">",",","src_lang_id","]",",","[","tgt",",","<","\/s",">",",","tgt_lang_id","]",",","decoder_start_token_id",":","tgt_lang_id","pegasus",",","pegasus_x",":","[","src",",","<","\/s",">","]",",","[","tgt",",","<","\/s",">","]",",","decoder_start_token_id",":","<","pad",">","prophetnet",":","[","src",",","[","SEP","]","]",",","[","tgt",",","[","SEP","]","]",",","decoder_start_token_id",":","[","SEP","]","t5",",","mt5",":","[","src",",","<","\/s",">","]",",","[","tgt",",","<","\/s",">","]",",","decoder_start_token_id",":","<","pad",">","LongT5",":","[","src",",","<","\/s",">","]",",","[","tgt",",","<","\/s",">","]",",","decoder_start_token_id",":","<","pad",">","marian",":","[","src",",","<","\/s",">","]",",","[","tgt",",","<","\/s",">","]",",","decoder_start_token_id",":","<","\/s",">","xlm-roberta",":","[","<","s",">",",","src",",","<","\/s",">",";","<","\/s",">",",","tgt",",","<","\/s",">","]",",","decoder_start_token_id",":","<","\/s",">","xlm-prophetnet",":","[","src",",","[","SEP","]","]",",","[","tgt",",","[","SEP","]","]",",","decoder_start_token_id",":","[","SEP","]","nllb",":","[","src_lang_id",",","src",",","<","\/s",">","]",",","[","tgt_lang_id",",","tgt",",","<","\/s",">","]",",","decoder_start_token_id",":","<","\/s",">","unilm",":","[","[","CLS","]",",","src",",","[","SEP","]","]",",","[","tgt",",","[","SEP","]","]",",","decoder_start_token_id",":","[","SEP","]","mass",":","[","src",",","[","SEP","]","]",",","[","tgt",",","[","SEP","]","]",",","decoder_start_token_id",":","[","SEP","]"]
code: def _init_params(self):
      r"""
      Casual models:
      cpm: [src, <sep>; tgt, <sep>]
      ctrl, openai-gpt: [src, </s>; tgt, </s>]
      gpt2, gpt_neo: [src, <|endoftext|>; tgt, <|endoftext|>]
      opt: [</s>, src, </s>; tgt, </s>]
  
      Encoder-decoder models:
      bart, led, mvp: [<s>, src, </s>], [<s>, tgt, </s>], decoder_start_token_id: </s>, forced_bos_token_id: <s>
      bert2bert: [[CLS], src, [SEP]], [tgt, [SEP]], decoder_start_token_id: [CLS]
      bigbird_pegasus: [src, </s>], [tgt, </s>], decoder_start_token_id: <s>
      blenderbot: [src, </s>], [tgt, </s>], decoder_start_token_id: <s>
      blenderbot-small: [src, __end__], [tgt, __end__], decoder_start_token_id: __start__
      m2m_100: [src_lang_id, src, </s>], [tgt_lang_id, tgt, </s>], decoder_start_token_id: </s>, forced_bos_token_id: tgt_lang_id
      mbart: [src, </s>, src_lang_id], [tgt, </s>, tgt_lang_id], decoder_start_token_id: tgt_lang_id
      pegasus, pegasus_x: [src, </s>], [tgt, </s>], decoder_start_token_id: <pad>
      prophetnet: [src, [SEP]], [tgt, [SEP]], decoder_start_token_id: [SEP]
      t5, mt5: [src, </s>], [tgt, </s>], decoder_start_token_id: <pad>
      LongT5: [src, </s>], [tgt, </s>], decoder_start_token_id: <pad>
      marian: [src, </s>], [tgt, </s>], decoder_start_token_id: </s>
      xlm-roberta: [<s>, src, </s>; </s>, tgt, </s>], decoder_start_token_id: </s>
      xlm-prophetnet: [src, [SEP]], [tgt, [SEP]], decoder_start_token_id: [SEP]
      nllb: [src_lang_id, src, </s>], [tgt_lang_id, tgt, </s>], decoder_start_token_id: </s>
      unilm: [[CLS], src, [SEP]], [tgt, [SEP]], decoder_start_token_id: [SEP]
      mass: [src, [SEP]], [tgt, [SEP]], decoder_start_token_id: [SEP]
      """
      # configuration needs to add pad token
      if self.model_name in ["ctrl", "gpt2", "gpt_neo", "openai-gpt"]:
          self.configuration.pad_token_id = self.tokenizer.eos_token_id
  
      # init `forced_bos_token_id` token
      if self.model_name in ["bart", "led", "mvp", "mass"]:
          self.configuration.forced_bos_token_id = (
              self.tokenizer.bos_token_id
          )
      elif self.model_name == "m2m_100":
          self.configuration.forced_bos_token_id = (
              self.tokenizer.get_lang_id(self.config["tgt_lang"])
          )
  
      # used in generate() for casual models
      if self.is_casual_model:
          self.configuration.eos_token_id = self.tokenizer.eos_token_id
  
      # set lang_id for xlm
      if self.model_name == "xlm":
          encoder_config = copy.deepcopy(self.configuration)
          decoder_config = copy.deepcopy(self.configuration)
          encoder_config.lang_id = self.configuration.lang2id[
              self.config["src_lang"]
          ]
          decoder_config.is_encoder = False
          decoder_config.causal = True
          decoder_config.lang_id = self.configuration.lang2id[
              self.config["tgt_lang"]
          ]
          self.configuration = (
              EncoderDecoderConfig.from_encoder_decoder_configs(
                  encoder_config, decoder_config
              )
          )
  
      # special settings for cpm
      if self.model_name == "cpm":
          import jieba
          import os
  
          jieba.dt.tmp_dir = "/tmp/jieba"
          os.makedirs(jieba.dt.tmp_dir, exist_ok=True)
  
file_path: TextBox/textbox/model/pretrained_models.py
imports: import os
  import copy
  import torch
  import torch.nn
  import warnings
  import inspect
  from .abstract_model import AbstractModel
  from transformers import AutoConfig, AutoModelForCausalLM, AutoModelForSeq2SeqLM, EncoderDecoderModel
  from transformers.models.encoder_decoder.configuration_encoder_decoder import EncoderDecoderConfig
  from ..utils.argument_list import efficient_kwargs_dict
label_desc: Use image node_id 2 for calling the Pretrained_Models obj's underlying member method code with example usage: obj._init_params() without return types