class_docstr: Generate Dense Embeddings.
class_docstr_tok: ["Generate","Dense","Embeddings","."]
docstr: File in/out args, and sharding args.
docstr_tok: ["File","in\/out","args",",","and","sharding","args","."]
code: def setup_args(cls):
      """
      File in/out args, and sharding args.
      """
      parser = ParlaiParser(True, True, "Generate Dense Embs")
      parser.add_argument(
          "--passages-file",
          type=str,
          help="file containing passages to encode. file should be a tsv file.",
      )
      parser.add_argument(
          "--outfile",
          type=str,
          help="where to save the passage embeddings",
      )
      parser.add_argument(
          "--num-shards",
          type=int,
          default=1,
          help="how many workers to use to split up the work",
      )
      parser.add_argument(
          "--shard-id",
          type=int,
          help="shard id for this worker. should be between 0 and num_shards",
      )
      parser.add_argument(
          "--dpr-model",
          type="bool",
          default=False,
          help="Specify True to indicate that the provided model file is a DPR Model",
      )
      return parser
  
imports: import os
  import torch
  import torch.cuda
  from typing import List, Tuple
  from parlai.agents.transformer.transformer import TransformerRankerAgent
  from parlai.agents.transformer.polyencoder import PolyencoderAgent
  from parlai.core.agents import create_agent_from_model_file, create_agent
  from parlai.core.build_data import modelzoo_path
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.script import ParlaiScript
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  import parlai.utils.logging
  from parlai.agents.transformer.dropout_poly import DropoutPolyAgent
  from parlai.agents.rag.retrievers import load_passages_list
  import parlai.agents.rag.dpr
label_desc: Use image node_id 1 for calling the Generator obj's underlying member method code with example usage: obj.setup_args(cls) and returns: parser