FaissPQIndexer

class lightning_ir.retrieve.faiss.faiss_indexer.FaissPQIndexer(index_dir: Path, index_config: FaissPQIndexConfig, module: BiEncoderModule, verbose: bool = False)[source]

Bases: _FaissTrainIndexer

FAISS PQ Indexer for approximate nearest neighbor search using Product Quantization (PQ).

__init__(index_dir: Path, index_config: FaissPQIndexConfig, module: BiEncoderModule, verbose: bool = False) None[source]

Initialize the FaissPQIndexer.

Parameters:
  • index_dir (Path) – Directory where the index will be stored.

  • index_config (FaissPQIndexConfig) – Configuration for the FAISS PQ index.

  • module (BiEncoderModule) – The BiEncoderModule to use for indexing.

  • verbose (bool) – Whether to enable verbose output. Defaults to False.

Methods

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

Initialize the FaissPQIndexer.

to_cpu()

Move the FAISS PQ index to CPU.

to_gpu()

Move the FAISS PQ index to GPU.

Attributes

INDEX_FACTORY

to_cpu() None[source]

Move the FAISS PQ index to CPU.

to_gpu() None[source]

Move the FAISS PQ index to GPU.