class_docstr: Script to convert a transformer-based fairseq model to ParlAI Model.
class_docstr_tok: ["Script","to","convert","a","transformer-based","fairseq","model","to","ParlAI","Model","."]
code: def setup_args(cls) -> ParlaiParser:
      parser = ParlaiParser()
      parser.add_argument(
          "--input",
          type=str,
          nargs="+",
          help="The input fairseq model path. Specify multiple to imply a join is necessary",
      )
      parser.add_argument(
          "--output", type=str, help="The output ParlAI model path"
      )
      parser.add_argument(
          "--vocab",
          type=str,
          help="The hugging face vocab file path, if applicable",
      )
      parser.add_argument(
          "--merge",
          type=str,
          help="The hugging face merge file path, if applicable",
      )
      parser.add_argument(
          "--add-prefix-space",
          type="bool",
          default=True,
          help="Add prefix space for hugging face bpe",
      )
      parser.add_argument(
          "--activation",
          type=str,
          help="Activation function",
          choices=["relu", "gelu"],
          default="gelu",
      )
      parser.add_argument(
          "--tokenizer",
          type=str,
          help="Dict tokenizer",
          choices=["bytelevelbpe", "gpt2"],
          default="bytelevelbpe",
      )
      parser.add_argument(
          "--delimiter", type=str, default="  ", help="Delimiter"
      )
      parser.add_argument(
          "--retain-bos-emb",
          type="bool",
          default=False,
          help="Retain the BOS embedding.",
      )
      parser.add_argument(
          "--model",
          type=str,
          default="transformer/generator",
          help="Which ParlAI agent to use.",
      )
      parser.add_argument(
          "--fp16",
          type="bool",
          default=False,
          help="Whether to initialize with fp16",
      )
      parser.add_argument(
          "--history-add-global-end-token",
          type="nonestr",
          default="end",
          hidden=True,
          choices=[None, "end"],
          help="Add special token to the end of history encoding.",
      )
      return parser
  
imports: from collections import OrderedDict
  import os
  import torch
  from torch.serialization import default_restore_location
  from typing import Any, Dict, List
  from parlai.core.agents import create_agent
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.script import ParlaiScript
  from parlai.utils.io import PathManager
  from parlai.scripts.vacuum import Vacuum
label_desc: Use image node_id 1 for calling the ConversionScript obj's underlying member method code with example usage: obj.setup_args(cls) and returns: parser