From bbae8cb88f66a94ad544fb42e2643e8e5c693f0a Mon Sep 17 00:00:00 2001 From: adilkhan Date: Tue, 29 Aug 2023 12:12:49 +0600 Subject: [PATCH 1/3] Added runtime argument --- libs/langchain/langchain/vectorstores/deeplake.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/langchain/langchain/vectorstores/deeplake.py b/libs/langchain/langchain/vectorstores/deeplake.py index ed76018322f..73696d6913c 100644 --- a/libs/langchain/langchain/vectorstores/deeplake.py +++ b/libs/langchain/langchain/vectorstores/deeplake.py @@ -62,6 +62,7 @@ class DeepLake(VectorStore): num_workers: int = 0, verbose: bool = True, exec_option: Optional[str] = None, + runtime: Optional[Dict] = None, **kwargs: Any, ) -> None: """Creates an empty DeepLakeVectorStore or loads an existing one. @@ -77,7 +78,7 @@ class DeepLake(VectorStore): >>> # Create a vector store in the Deep Lake Managed Tensor Database >>> data = DeepLake( ... path = "hub://org_id/dataset_name", - ... exec_option = "tensor_db", + ... runtime = {"tensor_db": True}, ... ) Args: @@ -114,6 +115,10 @@ class DeepLake(VectorStore): responsible for storage and query execution. Only for data stored in the Deep Lake Managed Database. Use runtime = {"db_engine": True} during dataset creation. + runtime (Dict, optional): Parameters for creating the Vector Store in + Deep Lake's Managed Tensor Database. Not applicable when loading an + existing Vector Store. To create a Vector Store in the Managed Tensor + Database, set `runtime = {"tensor_db": True}`. **kwargs: Other optional keyword arguments. Raises: @@ -131,11 +136,11 @@ class DeepLake(VectorStore): ) if ( - kwargs.get("runtime") == {"tensor_db": True} + runtime == {"tensor_db": True} and version_compare(deeplake.__version__, "3.6.7") == -1 ): raise ImportError( - "To use tensor_db option you need to update deeplake to `3.6.7`. " + "To use tensor_db option you need to update deeplake to `3.6.7` or higher. " f"Currently installed deeplake version is {deeplake.__version__}. " ) @@ -154,6 +159,7 @@ class DeepLake(VectorStore): token=token, exec_option=exec_option, verbose=verbose, + runtime=runtime, **kwargs, ) From 78c014399f3e63cf212224ec2e1f39faf95206f1 Mon Sep 17 00:00:00 2001 From: Bagatur Date: Tue, 29 Aug 2023 14:53:15 -0700 Subject: [PATCH 2/3] fmt --- libs/langchain/langchain/vectorstores/deeplake.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/langchain/langchain/vectorstores/deeplake.py b/libs/langchain/langchain/vectorstores/deeplake.py index 73696d6913c..9c8c8e15e19 100644 --- a/libs/langchain/langchain/vectorstores/deeplake.py +++ b/libs/langchain/langchain/vectorstores/deeplake.py @@ -115,9 +115,9 @@ class DeepLake(VectorStore): responsible for storage and query execution. Only for data stored in the Deep Lake Managed Database. Use runtime = {"db_engine": True} during dataset creation. - runtime (Dict, optional): Parameters for creating the Vector Store in - Deep Lake's Managed Tensor Database. Not applicable when loading an - existing Vector Store. To create a Vector Store in the Managed Tensor + runtime (Dict, optional): Parameters for creating the Vector Store in + Deep Lake's Managed Tensor Database. Not applicable when loading an + existing Vector Store. To create a Vector Store in the Managed Tensor Database, set `runtime = {"tensor_db": True}`. **kwargs: Other optional keyword arguments. From 0f85671630595a0c90a801c32950b44343981404 Mon Sep 17 00:00:00 2001 From: Bagatur Date: Tue, 29 Aug 2023 14:55:25 -0700 Subject: [PATCH 3/3] fmt --- libs/langchain/langchain/vectorstores/deeplake.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/langchain/langchain/vectorstores/deeplake.py b/libs/langchain/langchain/vectorstores/deeplake.py index 9c8c8e15e19..c5425294e87 100644 --- a/libs/langchain/langchain/vectorstores/deeplake.py +++ b/libs/langchain/langchain/vectorstores/deeplake.py @@ -140,7 +140,8 @@ class DeepLake(VectorStore): and version_compare(deeplake.__version__, "3.6.7") == -1 ): raise ImportError( - "To use tensor_db option you need to update deeplake to `3.6.7` or higher. " + "To use tensor_db option you need to update deeplake to `3.6.7` or " + "higher. " f"Currently installed deeplake version is {deeplake.__version__}. " )