From 546d163e13417ffc8dd30dd280bb7fa4287d59f3 Mon Sep 17 00:00:00 2001 From: Arjun Bingly Date: Tue, 26 Mar 2024 19:01:33 -0400 Subject: [PATCH] Top_k bug multivec retriever --- src/grag/components/multivec_retriever.py | 38 +++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/grag/components/multivec_retriever.py b/src/grag/components/multivec_retriever.py index 05478df..b7c8c2f 100644 --- a/src/grag/components/multivec_retriever.py +++ b/src/grag/components/multivec_retriever.py @@ -44,13 +44,13 @@ class Retriever: """ def __init__( - self, - vectordb: Optional[VectorDB] = None, - store_path: str = multivec_retriever_conf["store_path"], - id_key: str = multivec_retriever_conf["id_key"], - namespace: str = multivec_retriever_conf["namespace"], - top_k=1, - client_kwargs: Optional[Dict[str, Any]] = None, + self, + vectordb: Optional[VectorDB] = None, + store_path: str = multivec_retriever_conf["store_path"], + id_key: str = multivec_retriever_conf["id_key"], + namespace: str = multivec_retriever_conf["namespace"], + top_k=multivec_retriever_conf["top_k"], + client_kwargs: Optional[Dict[str, Any]] = None, ): """Initialize the Retriever. @@ -236,12 +236,12 @@ def get_docs_from_chunks(self, chunks: List[Document], one_to_one=False): return [d for d in docs if d is not None] def ingest( - self, - dir_path: Union[str, Path], - glob_pattern: str = "**/*.pdf", - dry_run: bool = False, - verbose: bool = True, - parser_kwargs: dict = None, + self, + dir_path: Union[str, Path], + glob_pattern: str = "**/*.pdf", + dry_run: bool = False, + verbose: bool = True, + parser_kwargs: dict = None, ): """Ingests the files in directory. @@ -278,12 +278,12 @@ def ingest( print(f"DRY RUN: found - {filepath.relative_to(dir_path)}") async def aingest( - self, - dir_path: Union[str, Path], - glob_pattern: str = "**/*.pdf", - dry_run: bool = False, - verbose: bool = True, - parser_kwargs: dict = None, + self, + dir_path: Union[str, Path], + glob_pattern: str = "**/*.pdf", + dry_run: bool = False, + verbose: bool = True, + parser_kwargs: dict = None, ): """Asynchronously ingests the files in directory.