Skip to content

Commit

Permalink
Update __init__.py (#2628)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2628

Fix erroneous logging `Failed to load GPU Faiss: No module named 'swigfaiss_gpu'. Will not load constructor refs for GPU indexes.` when I was running on a GPU-based index just fine.

`GpuIndex...` is loaded via loader.py.

X-link: facebookresearch/faiss#4086

Test Plan:
before
```
(faiss_gpu_cuvs_nightly) [[email protected] ~]$ python3 script.py
Failed to load GPU Faiss: No module named 'swigfaiss_gpu'. Will not load constructor refs for GPU indexes.
```

after
```
(faiss_gpu_cuvs_nightly) [[email protected] ~]$ python3
Python 3.12.8 | packaged by conda-forge | (main, Dec  5 2024, 14:24:40) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import faiss
>>>
```

Reviewed By: mnorris11

Differential Revision: D67118292

Pulled By: asadoughi

fbshipit-source-id: aa05aa20fe61e4ad75d4234f52e3b0d6a673a0b9
  • Loading branch information
asadoughi authored and facebook-github-bot committed Dec 12, 2024
1 parent 575e081 commit 8afe20e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/retrieval/knn_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def get_index(
res = faiss.StandardGpuResources()
# pyre-fixme[16]
config = faiss.GpuIndexIVFPQConfig()
# pyre-ignore[16]
index = faiss.GpuIndexIVFPQ(
res,
embedding_dim,
Expand Down

0 comments on commit 8afe20e

Please sign in to comment.