FaissSearcher

class lightning_ir.retrieve.faiss.faiss_searcher.FaissSearcher(index_dir: Path | str, search_config: FaissSearchConfig, module: BiEncoderModule, use_gpu: bool = False)[source]

Bases: ApproximateSearcher

FAISS-based searcher for approximate nearest neighbor retrieval in the Lightning IR framework.

__init__(index_dir: Path | str, search_config: FaissSearchConfig, module: BiEncoderModule, use_gpu: bool = False) None[source]

Initialize the FaissSearcher.

Parameters:
  • index_dir (Path | str) – Directory containing the FAISS index files.

  • search_config (FaissSearchConfig) – Configuration for the FAISS searcher.

  • module (BiEncoderModule) – The bi-encoder module used for embeddings.

  • use_gpu (bool) – Whether to use GPU for FAISS operations. Defaults to False.

Methods

__init__(index_dir, search_config, module[, ...])

Initialize the FaissSearcher.