code: def setup_args() -> ParlaiParser:
      parser = ParlaiParser(add_parlai_args=True, add_model_args=True)
      parser.add_argument(
          "-smf",
          "--scripted-model-file",
          type=str,
          default="_scripted.pt",
          help="Where the scripted model checkpoint will be saved",
      )
      parser.add_argument(
          "-in",
          "--input",
          type=str,
          default="",
          help="Input string to pass into the encoder of the scripted model, to test it against the unscripted version. Separate lines with a pipe",
      )
      parser.add_argument(
          "-sm",
          "--script-module",
          type=str,
          default="parlai.torchscript.modules:TorchScriptGreedySearch",
          help="module to TorchScript. Example: parlai.torchscript.modules:TorchScriptGreedySearch",
      )
      parser.add_argument(
          "-eio",
          "--enable-inference-optimization",
          type=bool,
          default=False,
          help="Enable inference optimizations on the scripted model.",
      )
      return parser
  
file_path: ParlAI/parlai/scripts/torchscript.py
imports: import importlib
  from typing import List
  import torch.jit
  import torch.nn
  from packaging import version
  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, register_script
  from parlai.utils.io import PathManager
label_desc: Use image node_id 2 for calling a global function with example usage: setup_args() and returns: parser