'How to store FAISS IndexFlatL2 Object for further usage in other modules?
I am building a schematic search model for a large corpus of data using FAISS library. For the searching operation I am using the "IndexFlatL2" method in the FAISS library, which in background uses the Euclidean distance for finding the nearest neighbor. The python implementation is as shown.
import faiss as fs
fs_index = fs.IndexFlatL2(768)
fs_index.add(train_embeddings)
D,I = fs_index.search(query,k=1)
Now, I am trying to store the fs_index object as model file (i.e. like traditional ML model pickle or joblib file) so that I can use the same file for prediction of other queries in the other modules/other packages.
So, Is there a way to store this index object as joblib/pickle file for further use of this model in anyother place as required?
Thanks in Advance
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
