dl4ds_tutor / code /modules /retriever /faiss_retriever.py
XThomasBU
init commit
f51bb92
raw
history blame
709 Bytes
from .helpers import VectorStoreRetrieverScore
from .base import BaseRetriever
class FaissRetriever(BaseRetriever):
def __init__(self):
pass
def return_retriever(self, db, config):
retriever = VectorStoreRetrieverScore(
vectorstore=db,
# search_type="similarity_score_threshold",
# search_kwargs={
# "score_threshold": self.config["vectorstore"][
# "score_threshold"
# ],
# "k": self.config["vectorstore"]["search_top_k"],
# },
search_kwargs={
"k": config["vectorstore"]["search_top_k"],
},
)
return retriever