code: def _add_inference_args(parser):
      group = parser.add_argument_group(title="inference")
  
      group.add_argument(
          "--inference-batch-times-seqlen-threshold",
          type=int,
          default=512,
          help="During inference, if batch-size times "
          "sequence-length is smaller than this threshold "
          "then we will not use pipelining, otherwise we will.",
      )
      group.add_argument(
          "--max-tokens-to-oom",
          type=int,
          default=12000,
          help="Maximum number of tokens during inference"
          "tokens here is # in prompt + # to generate"
          "Allows us to throw an error before OOM crashes server",
      )
      group.add_argument(
          "--output-bert-embeddings",
          action="store_true",
          help="Output Bert embeddings (via mean pooling) from "
          "model, rather than its binary head output or entire "
          "hidden batch.",
      )
      group.add_argument(
          "--bert-embedder-type",
          default="megatron",
          choices=["megatron", "huggingface"],
          help="Select either Megatron or Huggingface as the "
          "Bert embedder.",
      )
  
      return parser
  
imports: import argparse
  import dataclasses
  import json
  import os
  import torch
  import types
  import torch.nn.functional
  from megatron.global_vars import set_retro_args, get_retro_args
  from tools.retro.utils import get_args_path
  from megatron.core.models.retro import RetroConfig
  from megatron.core.transformer import TransformerConfig
label_desc: Use image node_id 7 for calling a global function with example usage: _add_inference_args(parser) and returns: parser