class_docstr: Index Dense Embeddings.
class_docstr_tok: ["Index","Dense","Embeddings","."]
docstr: Setup args.
docstr_tok: ["Setup","args","."]
code: def setup_args(cls):
      """
      Setup args.
      """
      parser = ParlaiParser(True, True, "Index Dense Embs")
      parser.add_argument(
          "--embeddings-dir", type=str, help="directory of embeddings"
      )
      parser.add_argument(
          "--embeddings-name",
          type=str,
          default="",
          help="name of emb part",
      )
      parser.add_argument(
          "--partition-index",
          type="bool",
          default=False,
          help="specify True to partition indexing per file (useful when all files do not fit into memory)",
      )
      parser.add_argument(
          "--save-index-dir",
          type=str,
          help="directory in which to save index",
          default=None,
      )
      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 = RagAgent.add_cmdline_args(parser)
      parser.set_defaults(compressed_indexer_gpu_train=True)
      return parser
  
file_path: ParlAI/parlai/agents/rag/scripts/index_dense_embeddings.py
imports: import os
  import random
  import torch
  from typing import List
  from parlai.core.params import ParlaiParser
  from parlai.core.script import ParlaiScript
  import parlai.utils.logging
  from parlai.agents.rag.rag import RagAgent
  from parlai.agents.rag.indexers import indexer_factory, CompressedIndexer
label_desc: Use image node_id 1 for calling the Indexer obj's underlying member method code with example usage: obj.setup_args(cls) and returns: parser