Repository: activeloopai/Hub
File: deeplake/core/vectorstore/vector_search/dataset/dataset.py (Python)

Code before:
    **kwargs,
):
    if dataset_path == DEFAULT_VECTORSTORE_DEEPLAKE_PATH:
        logger.warning(
            f"The default deeplake path location is used: {DEFAULT_VECTORSTORE_DEEPLAKE_PATH}"
            " and it is not free. All addtionally added data will be added on"
            " top of already existing deeplake dataset."
        )
    dataset = deeplake.load(
        dataset_path,
        token=token,
        read_only=read_only,
        creds=creds,
        verbose=False,
        **kwargs,
    )
    check_tensors(dataset)

    logger.warning(
        f"Deep Lake Dataset in {dataset_path} already exists, "
        f"loading from the storage"
    )

    if runtime == {"tensor_db": True}:
        logger.warning(
            "Specifying `runtime` option during dataset loading is not supported. "
            "This parameter will be ignored. If you wanted to transfer the dataset "
            "to managed database consider looking into the documentation: "
            "(https://docs.activeloop.ai/enterprise-features/managed-database/migrating-datasets-to-the-tensor-database)."
        )

    return dataset


def check_tensors(dataset):
    tensors = dataset.tensors

    embedding_tensor_exist = False
    ids_exist = False

    for tensor in tensors:
        htype = dataset[tensor].htype

        if tensor in ("id", "ids"):
            ids_exist = True

        if tensor in ("embedding", "embeddings"):
            embedding_tensor_exist = True

            # TODO: Add back once old datasets without embedding htype are not in circulation
            # if htype not in (None, "embedding"):

Review comment (suggestion):
@adolkhan Pls change to:

Specifying `runtime` option when loading a Vector Store is not supported and this parameter will be ignored. If you wanted to create a new Vector Store, please specify a path to a Vector Store that does not already exist. To transfer an existing Vector Store to the Managed Tensor Database, use the steps in the link below:
(https://docs.activeloop.ai/enterprise-features/managed-database/migrating-datasets-to-the-tensor-database).

Code after:
    runtime,
    **kwargs,
):
    if dataset_path == DEFAULT_VECTORSTORE_DEEPLAKE_PATH:
        logger.warning(
            f"The default deeplake path location is used: {DEFAULT_VECTORSTORE_DEEPLAKE_PATH}"
            " and it is not free. All addtionally added data will be added on"
            " top of already existing deeplake dataset."
        )
    dataset = deeplake.load(
        dataset_path,
        token=token,
        read_only=read_only,
        creds=creds,
        verbose=False,
        **kwargs,
    )
    check_tensors(dataset)

    logger.warning(
        f"Deep Lake Dataset in {dataset_path} already exists, "
        f"loading from the storage"
    )

    if runtime is not None and runtime["tensor_db"] == True:
        logger.warning(
            "Specifying runtime option when loading a Vector Store is not supported and this parameter will "
            "be ignored. If you wanted to create a new Vector Store, please specify a path to a Vector Store "
            "that does not already exist. To transfer an existing Vector Store to the Managed Tensor Database, "
            "use the steps in the link below: "
            "(https://docs.activeloop.ai/enterprise-features/managed-database/migrating-datasets-to-the-tensor-database)."
        )

    return dataset


def check_tensors(dataset):
    tensors = dataset.tensors

    embedding_tensor_exist = False
    ids_exist = False

    for tensor in tensors:
        htype = dataset[tensor].htype

        if tensor in ("id", "ids"):
            ids_exist = True

        if tensor in ("embedding", "embeddings"):
            embedding_tensor_exist = True