Skip to content

Commit

Permalink
remove use gpu index faiss
Browse files Browse the repository at this point in the history
  • Loading branch information
fschlatt committed Jan 1, 2025
1 parent 38519e6 commit 4dc0c94
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lightning_ir/retrieve/faiss/faiss_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ def __init__(
search_config: FaissSearchConfig,
module: BiEncoderModule,
use_gpu: bool = False,
use_gpu_index: bool = False,
) -> None:
import faiss

self.search_config: FaissSearchConfig
self.index = faiss.read_index(str(Path(index_dir) / "index.faiss"))
if use_gpu and use_gpu_index and hasattr(faiss, "index_cpu_to_all_gpus"):
if use_gpu and hasattr(faiss, "index_cpu_to_all_gpus"):
self.index = faiss.index_cpu_to_all_gpus(self.index)
ivf_index = None
try:
Expand Down

0 comments on commit 4dc0c94

Please sign in to comment.