class_docstr: An index which can be deserialized from the files built using https://github.com/facebookresearch/DPR. We use
  default faiss index parameters as specified in that repository.
  
  Args:
      vector_size (`int`):
          The dimension of indexed vectors.
      index_path (`str`):
          A path to a *directory* containing index files compatible with [`~models.rag.retrieval_rag.LegacyIndex`]
class_docstr_tok: ["An","index","which","can","be","deserialized","from","the","files","built","using","https",":","\/\/github.com\/facebookresearch\/DPR",".","We","use","default","faiss","index","parameters","as","specified","in","that","repository",".","Args",":","vector_size","(","`","int","`",")",":","The","dimension","of","indexed","vectors",".","index_path","(","`","str","`",")",":","A","path","to","a","*","directory","*","containing","index","files","compatible","with","[","`","~models.rag.retrieval_rag.LegacyIndex","`","]"]
code: def __init__(self, vector_size, index_path):
      self.index_id_to_db_id = []
      self.index_path = index_path
      self.passages = self._load_passages()
      self.vector_size = vector_size
      self.index = None
      self._index_initialized = False
  
imports: import os
  import pickle
  import time
  from typing import Iterable, List, Optional, Tuple
  import numpy
  from ...tokenization_utils import PreTrainedTokenizer
  from ...tokenization_utils_base import BatchEncoding
  from ...utils import cached_file, is_datasets_available, is_faiss_available, logging, requires_backends, strtobool
  from .configuration_rag import RagConfig
  from .tokenization_rag import RagTokenizer
label_desc: Use image node_id 1 to create a new LegacyIndex object from inherited base classes: Index with example: obj = LegacyIndex(vector_size, index_path)