Skip to content

Commit

Permalink
Added runtime argument
Browse files Browse the repository at this point in the history
  • Loading branch information
adolkhan committed Aug 29, 2023
1 parent e80834d commit bbae8cb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libs/langchain/langchain/vectorstores/deeplake.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def __init__(
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.
Expand All @@ -77,7 +78,7 @@ def __init__(
>>> # 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:
Expand Down Expand Up @@ -114,6 +115,10 @@ def __init__(
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:
Expand All @@ -131,11 +136,11 @@ def __init__(
)

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__}. "
)

Expand All @@ -154,6 +159,7 @@ def __init__(
token=token,
exec_option=exec_option,
verbose=verbose,
runtime=runtime,
**kwargs,
)

Expand Down

0 comments on commit bbae8cb

Please sign in to comment.