From c601dc1a37075f5147885a681f0a69db873335b1 Mon Sep 17 00:00:00 2001 From: FayazRahman Date: Thu, 25 May 2023 11:44:49 +0530 Subject: [PATCH 1/3] deeplake vector db --- .../deeplake/deeplake_langchain_qa.ipynb | 904 ++++++++++++++++++ 1 file changed, 904 insertions(+) create mode 100644 examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb diff --git a/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb b/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb new file mode 100644 index 0000000000..b7d03cff7e --- /dev/null +++ b/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb @@ -0,0 +1,904 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "412cdebd7786475b990851f82d0b6ad3": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HBoxModel", + "model_module_version": "1.5.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_bf2a79f0685b4f539854c1b6a0b536cf", + "IPY_MODEL_fe4fdc0681724ceaa73904f459f7b870", + "IPY_MODEL_11c779eb13154d6c9056abc64c7d9b58" + ], + "layout": "IPY_MODEL_f32ec3f5376e43479579478b1a3ba1ae" + } + }, + "bf2a79f0685b4f539854c1b6a0b536cf": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "model_module_version": "1.5.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_76057b03fb3d4954873f108d02abadd5", + "placeholder": "​", + "style": "IPY_MODEL_a09ed4a8294946a1809fb2542424b4eb", + "value": "100%" + } + }, + "fe4fdc0681724ceaa73904f459f7b870": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "model_module_version": "1.5.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "success", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_c8142883000a48159003babd190b2c31", + "max": 1, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_9558945372da4f93a016f7fd6b4892d9", + "value": 1 + } + }, + "11c779eb13154d6c9056abc64c7d9b58": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "model_module_version": "1.5.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_8f3b8cdbda77422ba37dbffb5ca4b010", + "placeholder": "​", + "style": "IPY_MODEL_d2e5189d38e34963bb54b57e9e9e873b", + "value": " 1/1 [00:09<00:00, 9.18s/it]" + } + }, + "f32ec3f5376e43479579478b1a3ba1ae": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "76057b03fb3d4954873f108d02abadd5": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "a09ed4a8294946a1809fb2542424b4eb": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "model_module_version": "1.5.0", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "c8142883000a48159003babd190b2c31": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "9558945372da4f93a016f7fd6b4892d9": { + "model_module": "@jupyter-widgets/controls", + "model_name": "ProgressStyleModel", + "model_module_version": "1.5.0", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "8f3b8cdbda77422ba37dbffb5ca4b010": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "d2e5189d38e34963bb54b57e9e9e873b": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "model_module_version": "1.5.0", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + } + } + } + }, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Question Answering with LangChain, Deep Lake, & OpenAI\n", + "\n", + "This notebook shows how to implement a question answering system with LangChain, [Deep Lake](https://https://activeloop.ai/) as a vector store and OpenAI embeddings. We will take the following steps to achieve this:\n", + "\n", + "1. Load a Deep Lake text dataset\n", + "2. Initialize a [Deep Lake vector store with LangChain](https://https://docs.activeloop.ai/tutorials/deep-lake-vector-store-in-langchain)\n", + "3. Add text to the vector store\n", + "4. Run queries on the database\n", + "5. Done!\n", + "\n", + "You can also follow other tutorials such as question answering over any type of data (PDFs, json, csv, text): [chatting with any data](https://https://www.activeloop.ai/resources/data-chad-an-ai-app-with-lang-chain-deep-lake-to-chat-with-any-data/) stored in Deep Lake, [code understanding](https://www.activeloop.ai/resources/lang-chain-gpt-4-for-code-understanding-twitter-algorithm/), or [question answering over PDFs](https://https://www.activeloop.ai/resources/ultimate-guide-to-lang-chain-deep-lake-build-chat-gpt-to-answer-questions-on-your-financial-data/), or [recommending songs](https://www.activeloop.ai/resources/3-ways-to-build-a-recommendation-engine-for-songs-with-lang-chain/)." + ], + "metadata": { + "id": "Ol5OkztZqoAW" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Install requirements\n", + "Let's install the following packages." + ], + "metadata": { + "id": "6uKh5KahrBs3" + } + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "cPsdluAqqnRH", + "outputId": "e55ab53c-391a-4d24-ba81-9e3b3f03d443" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", + "Requirement already satisfied: deeplake in /usr/local/lib/python3.10/dist-packages (3.5.2)\n", + "Requirement already satisfied: langchain in /usr/local/lib/python3.10/dist-packages (0.0.176)\n", + "Requirement already satisfied: openai in /usr/local/lib/python3.10/dist-packages (0.27.7)\n", + "Requirement already satisfied: tiktoken in /usr/local/lib/python3.10/dist-packages (0.4.0)\n", + "Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from deeplake) (1.22.4)\n", + "Requirement already satisfied: pillow in /usr/local/lib/python3.10/dist-packages (from deeplake) (8.4.0)\n", + "Requirement already satisfied: boto3 in /usr/local/lib/python3.10/dist-packages (from deeplake) (1.26.76)\n", + "Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from deeplake) (8.1.3)\n", + "Requirement already satisfied: pathos in /usr/local/lib/python3.10/dist-packages (from deeplake) (0.3.0)\n", + "Requirement already satisfied: humbug>=0.3.1 in /usr/local/lib/python3.10/dist-packages (from deeplake) (0.3.1)\n", + "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from deeplake) (4.65.0)\n", + "Requirement already satisfied: numcodecs in /usr/local/lib/python3.10/dist-packages (from deeplake) (0.11.0)\n", + "Requirement already satisfied: pyjwt in /usr/local/lib/python3.10/dist-packages (from deeplake) (2.7.0)\n", + "Requirement already satisfied: aioboto3>=10.4.0 in /usr/local/lib/python3.10/dist-packages (from deeplake) (11.2.0)\n", + "Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.10/dist-packages (from deeplake) (1.5.6)\n", + "Requirement already satisfied: PyYAML>=5.4.1 in /usr/local/lib/python3.10/dist-packages (from langchain) (6.0)\n", + "Requirement already satisfied: SQLAlchemy<3,>=1.4 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.0.10)\n", + "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in /usr/local/lib/python3.10/dist-packages (from langchain) (3.8.4)\n", + "Requirement already satisfied: async-timeout<5.0.0,>=4.0.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (4.0.2)\n", + "Requirement already satisfied: dataclasses-json<0.6.0,>=0.5.7 in /usr/local/lib/python3.10/dist-packages (from langchain) (0.5.7)\n", + "Requirement already satisfied: numexpr<3.0.0,>=2.8.4 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.8.4)\n", + "Requirement already satisfied: openapi-schema-pydantic<2.0,>=1.2 in /usr/local/lib/python3.10/dist-packages (from langchain) (1.2.4)\n", + "Requirement already satisfied: pydantic<2,>=1 in /usr/local/lib/python3.10/dist-packages (from langchain) (1.10.7)\n", + "Requirement already satisfied: requests<3,>=2 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.27.1)\n", + "Requirement already satisfied: tenacity<9.0.0,>=8.1.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (8.2.2)\n", + "Requirement already satisfied: regex>=2022.1.18 in /usr/local/lib/python3.10/dist-packages (from tiktoken) (2022.10.31)\n", + "Requirement already satisfied: aiobotocore[boto3]==2.5.0 in /usr/local/lib/python3.10/dist-packages (from aioboto3>=10.4.0->deeplake) (2.5.0)\n", + "Requirement already satisfied: botocore<1.29.77,>=1.29.76 in /usr/local/lib/python3.10/dist-packages (from aiobotocore[boto3]==2.5.0->aioboto3>=10.4.0->deeplake) (1.29.76)\n", + "Requirement already satisfied: wrapt>=1.10.10 in /usr/local/lib/python3.10/dist-packages (from aiobotocore[boto3]==2.5.0->aioboto3>=10.4.0->deeplake) (1.14.1)\n", + "Requirement already satisfied: aioitertools>=0.5.1 in /usr/local/lib/python3.10/dist-packages (from aiobotocore[boto3]==2.5.0->aioboto3>=10.4.0->deeplake) (0.11.0)\n", + "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (23.1.0)\n", + "Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (2.0.12)\n", + "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (6.0.4)\n", + "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.9.2)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.3.3)\n", + "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.3.1)\n", + "Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from boto3->deeplake) (1.0.1)\n", + "Requirement already satisfied: s3transfer<0.7.0,>=0.6.0 in /usr/local/lib/python3.10/dist-packages (from boto3->deeplake) (0.6.1)\n", + "Requirement already satisfied: marshmallow<4.0.0,>=3.3.0 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain) (3.19.0)\n", + "Requirement already satisfied: marshmallow-enum<2.0.0,>=1.5.1 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain) (1.5.1)\n", + "Requirement already satisfied: typing-inspect>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain) (0.8.0)\n", + "Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<2,>=1->langchain) (4.5.0)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (1.26.15)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (2022.12.7)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (3.4)\n", + "Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy<3,>=1.4->langchain) (2.0.2)\n", + "Requirement already satisfied: entrypoints in /usr/local/lib/python3.10/dist-packages (from numcodecs->deeplake) (0.4)\n", + "Requirement already satisfied: ppft>=1.7.6.6 in /usr/local/lib/python3.10/dist-packages (from pathos->deeplake) (1.7.6.6)\n", + "Requirement already satisfied: dill>=0.3.6 in /usr/local/lib/python3.10/dist-packages (from pathos->deeplake) (0.3.6)\n", + "Requirement already satisfied: pox>=0.3.2 in /usr/local/lib/python3.10/dist-packages (from pathos->deeplake) (0.3.2)\n", + "Requirement already satisfied: multiprocess>=0.70.14 in /usr/local/lib/python3.10/dist-packages (from pathos->deeplake) (0.70.14)\n", + "Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python3.10/dist-packages (from botocore<1.29.77,>=1.29.76->aiobotocore[boto3]==2.5.0->aioboto3>=10.4.0->deeplake) (2.8.2)\n", + "Requirement already satisfied: packaging>=17.0 in /usr/local/lib/python3.10/dist-packages (from marshmallow<4.0.0,>=3.3.0->dataclasses-json<0.6.0,>=0.5.7->langchain) (23.1)\n", + "Requirement already satisfied: mypy-extensions>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from typing-inspect>=0.4.0->dataclasses-json<0.6.0,>=0.5.7->langchain) (1.0.0)\n", + "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.29.77,>=1.29.76->aiobotocore[boto3]==2.5.0->aioboto3>=10.4.0->deeplake) (1.16.0)\n" + ] + } + ], + "source": [ + "!pip install deeplake langchain openai tiktoken" + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Authentication\n", + "Provide your OpenAI API key here:" + ], + "metadata": { + "id": "IUm1NzURrGte" + } + }, + { + "cell_type": "code", + "source": [ + "import getpass\n", + "import os\n", + "\n", + "os.environ['OPENAI_API_KEY'] = getpass.getpass()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Q_-OiwJzrJ8m", + "outputId": "00a24254-42d1-4d8b-92ec-7b6babd3a930" + }, + "execution_count": null, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "··········\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Load a Deep Lake text dataset\n", + "We will use a 20000 sample subset of the [cohere-wikipedia-22](https://app.activeloop.ai/davitbun/cohere-wikipedia-22) dataset for this example." + ], + "metadata": { + "id": "ok-hgiotrLmS" + } + }, + { + "cell_type": "code", + "source": [ + "import deeplake\n", + "\n", + "ds = deeplake.load(\"hub://activeloop/cohere-wikipedia-22-sample\")\n", + "ds.summary()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "cIj5g4smrwOm", + "outputId": "3d6b7c6a-fb40-41b3-c875-1579b7e1e47c" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "-" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "This dataset can be visualized in Jupyter Notebook by ds.visualize() or at https://app.activeloop.ai/activeloop/cohere-wikipedia-22-sample\n", + "\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "|" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "hub://activeloop/cohere-wikipedia-22-sample loaded successfully.\n", + "\n", + "Dataset(path='hub://activeloop/cohere-wikipedia-22-sample', read_only=True, tensors=['ids', 'metadata', 'text'])\n", + "\n", + " tensor htype shape dtype compression\n", + " ------- ------- ------- ------- ------- \n", + " ids text (20000, 1) str None \n", + " metadata json (20000, 1) str None \n", + " text text (20000, 1) str None \n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r \r\r \r" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "Let's take a look at a few samples:" + ], + "metadata": { + "id": "oY6FHqovHPfJ" + } + }, + { + "cell_type": "code", + "source": [ + "ds[:3].text.data()[\"value\"]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "IWPYDrtUHPEr", + "outputId": "82329129-fcd4-43b7-e498-bd3e006d32eb" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "['The 24-hour clock is a way of telling the time in which the day runs from midnight to midnight and is divided into 24 hours, numbered from 0 to 23. It does not use a.m. or p.m. This system is also referred to (only in the US and the English speaking parts of Canada) as military time or (only in the United Kingdom and now very rarely) as continental time. In some parts of the world, it is called railway time. Also, the international standard notation of time (ISO 8601) is based on this format.',\n", + " 'A time in the 24-hour clock is written in the form hours:minutes (for example, 01:23), or hours:minutes:seconds (01:23:45). Numbers under 10 have a zero in front (called a leading zero); e.g. 09:07. Under the 24-hour clock system, the day begins at midnight, 00:00, and the last minute of the day begins at 23:59 and ends at 24:00, which is identical to 00:00 of the following day. 12:00 can only be mid-day. Midnight is called 24:00 and is used to mean the end of the day and 00:00 is used to mean the beginning of the day. For example, you would say \"Tuesday at 24:00\" and \"Wednesday at 00:00\" to mean exactly the same time.',\n", + " 'However, the US military prefers not to say 24:00 - they do not like to have two names for the same thing, so they always say \"23:59\", which is one minute before midnight.']" + ] + }, + "metadata": {}, + "execution_count": 27 + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "## LangChain's Deep Lake vector store\n", + "Let's define a `dataset_path`, this is where your Deep Lake vector store will house the text embeddings." + ], + "metadata": { + "id": "JRFPjoDaGcSa" + } + }, + { + "cell_type": "code", + "source": [ + "dataset_path = 'wikipedia-embeddings-deeplake'" + ], + "metadata": { + "id": "Klobw6_T257K" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We will setup OpenAI's `text-embedding-ada-002` as our embedding function and initialize a Deep Lake vector store at `dataset_path`..." + ], + "metadata": { + "id": "IW6BZubFGgu2" + } + }, + { + "cell_type": "code", + "source": [ + "from langchain.embeddings.openai import OpenAIEmbeddings\n", + "from langchain.vectorstores import DeepLake\n", + "\n", + "embedding = OpenAIEmbeddings(model=\"text-embedding-ada-002\")\n", + "db = DeepLake(dataset_path, embedding_function=embedding, overwrite=True)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ykE3HgSl5mcg", + "outputId": "5a08cd34-369c-4735-826b-2ce39a9ab6b1" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "wikipedia-embeddings-deeplake loaded successfully.\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "... and populate it with samples, one batch at a time, using the `add_texts` method." + ], + "metadata": { + "id": "6mt2S1XpGj-D" + } + }, + { + "cell_type": "code", + "source": [ + "from tqdm.auto import tqdm\n", + "\n", + "batch_size = 100\n", + "\n", + "nsamples = 10 # for testing. Replace with len(ds) to append everything\n", + "for i in tqdm(range(0, nsamples, batch_size)):\n", + " # find end of batch\n", + " i_end = min(nsamples, i + batch_size)\n", + "\n", + " batch = ds[i:i_end]\n", + " id_batch = batch.ids.data()[\"value\"]\n", + " text_batch = batch.text.data()[\"value\"]\n", + " meta_batch = batch.metadata.data()[\"value\"]\n", + "\n", + " db.add_texts(text_batch, metadatas=meta_batch, ids=id_batch)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 240, + "referenced_widgets": [ + "412cdebd7786475b990851f82d0b6ad3", + "bf2a79f0685b4f539854c1b6a0b536cf", + "fe4fdc0681724ceaa73904f459f7b870", + "11c779eb13154d6c9056abc64c7d9b58", + "f32ec3f5376e43479579478b1a3ba1ae", + "76057b03fb3d4954873f108d02abadd5", + "a09ed4a8294946a1809fb2542424b4eb", + "c8142883000a48159003babd190b2c31", + "9558945372da4f93a016f7fd6b4892d9", + "8f3b8cdbda77422ba37dbffb5ca4b010", + "d2e5189d38e34963bb54b57e9e9e873b" + ] + }, + "id": "hFJTvNGE53lS", + "outputId": "2801750a-9925-4c90-f802-6899b2613924" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + " 0%| | 0/1 [00:00 Date: Thu, 28 Sep 2023 21:36:56 +0530 Subject: [PATCH 2/3] update notebook --- .../deeplake/deeplake_langchain_qa.ipynb | 371 ++++++++++-------- 1 file changed, 216 insertions(+), 155 deletions(-) diff --git a/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb b/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb index b7d03cff7e..97fb135d40 100644 --- a/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb +++ b/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb @@ -14,7 +14,7 @@ }, "widgets": { "application/vnd.jupyter.widget-state+json": { - "412cdebd7786475b990851f82d0b6ad3": { + "e6fbf36f17aa48ab9438e5761b0401dd": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", @@ -29,14 +29,14 @@ "_view_name": "HBoxView", "box_style": "", "children": [ - "IPY_MODEL_bf2a79f0685b4f539854c1b6a0b536cf", - "IPY_MODEL_fe4fdc0681724ceaa73904f459f7b870", - "IPY_MODEL_11c779eb13154d6c9056abc64c7d9b58" + "IPY_MODEL_5201df20cba84fb3b81ae4d53e882fc8", + "IPY_MODEL_27c0bb794fba475ea32cd41b16378227", + "IPY_MODEL_c35c752ec6474d89812b3482d33f6238" ], - "layout": "IPY_MODEL_f32ec3f5376e43479579478b1a3ba1ae" + "layout": "IPY_MODEL_1f0b742990134059b7697733c5f1ab8c" } }, - "bf2a79f0685b4f539854c1b6a0b536cf": { + "5201df20cba84fb3b81ae4d53e882fc8": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", @@ -51,13 +51,13 @@ "_view_name": "HTMLView", "description": "", "description_tooltip": null, - "layout": "IPY_MODEL_76057b03fb3d4954873f108d02abadd5", + "layout": "IPY_MODEL_d4a9c77f01094292aab3c78a4ccf128a", "placeholder": "​", - "style": "IPY_MODEL_a09ed4a8294946a1809fb2542424b4eb", + "style": "IPY_MODEL_abe2881cfa9d4b4782efe881c7dee10b", "value": "100%" } }, - "fe4fdc0681724ceaa73904f459f7b870": { + "27c0bb794fba475ea32cd41b16378227": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", @@ -73,15 +73,15 @@ "bar_style": "success", "description": "", "description_tooltip": null, - "layout": "IPY_MODEL_c8142883000a48159003babd190b2c31", + "layout": "IPY_MODEL_cf09f50ca94248008c240d06e40c220c", "max": 1, "min": 0, "orientation": "horizontal", - "style": "IPY_MODEL_9558945372da4f93a016f7fd6b4892d9", + "style": "IPY_MODEL_7d0289d710aa4b43abd0cdf90b0161fc", "value": 1 } }, - "11c779eb13154d6c9056abc64c7d9b58": { + "c35c752ec6474d89812b3482d33f6238": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", @@ -96,13 +96,13 @@ "_view_name": "HTMLView", "description": "", "description_tooltip": null, - "layout": "IPY_MODEL_8f3b8cdbda77422ba37dbffb5ca4b010", + "layout": "IPY_MODEL_1391cd423ed24c4badebed8b67a86d0b", "placeholder": "​", - "style": "IPY_MODEL_d2e5189d38e34963bb54b57e9e9e873b", - "value": " 1/1 [00:09<00:00, 9.18s/it]" + "style": "IPY_MODEL_32edd96788a948f8adc487687378dd26", + "value": " 1/1 [00:03<00:00, 3.34s/it]" } }, - "f32ec3f5376e43479579478b1a3ba1ae": { + "1f0b742990134059b7697733c5f1ab8c": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", @@ -154,7 +154,7 @@ "width": null } }, - "76057b03fb3d4954873f108d02abadd5": { + "d4a9c77f01094292aab3c78a4ccf128a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", @@ -206,7 +206,7 @@ "width": null } }, - "a09ed4a8294946a1809fb2542424b4eb": { + "abe2881cfa9d4b4782efe881c7dee10b": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", @@ -221,7 +221,7 @@ "description_width": "" } }, - "c8142883000a48159003babd190b2c31": { + "cf09f50ca94248008c240d06e40c220c": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", @@ -273,7 +273,7 @@ "width": null } }, - "9558945372da4f93a016f7fd6b4892d9": { + "7d0289d710aa4b43abd0cdf90b0161fc": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", @@ -289,7 +289,7 @@ "description_width": "" } }, - "8f3b8cdbda77422ba37dbffb5ca4b010": { + "1391cd423ed24c4badebed8b67a86d0b": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", @@ -341,7 +341,7 @@ "width": null } }, - "d2e5189d38e34963bb54b57e9e9e873b": { + "32edd96788a948f8adc487687378dd26": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", @@ -365,15 +365,15 @@ "source": [ "# Question Answering with LangChain, Deep Lake, & OpenAI\n", "\n", - "This notebook shows how to implement a question answering system with LangChain, [Deep Lake](https://https://activeloop.ai/) as a vector store and OpenAI embeddings. We will take the following steps to achieve this:\n", + "This notebook shows how to implement a question answering system with LangChain, [Deep Lake](https://activeloop.ai/) as a vector store and OpenAI embeddings. We will take the following steps to achieve this:\n", "\n", "1. Load a Deep Lake text dataset\n", - "2. Initialize a [Deep Lake vector store with LangChain](https://https://docs.activeloop.ai/tutorials/deep-lake-vector-store-in-langchain)\n", + "2. Initialize a [Deep Lake vector store with LangChain](https://docs.activeloop.ai/tutorials/vector-store/deep-lake-vector-store-in-langchain)\n", "3. Add text to the vector store\n", "4. Run queries on the database\n", "5. Done!\n", "\n", - "You can also follow other tutorials such as question answering over any type of data (PDFs, json, csv, text): [chatting with any data](https://https://www.activeloop.ai/resources/data-chad-an-ai-app-with-lang-chain-deep-lake-to-chat-with-any-data/) stored in Deep Lake, [code understanding](https://www.activeloop.ai/resources/lang-chain-gpt-4-for-code-understanding-twitter-algorithm/), or [question answering over PDFs](https://https://www.activeloop.ai/resources/ultimate-guide-to-lang-chain-deep-lake-build-chat-gpt-to-answer-questions-on-your-financial-data/), or [recommending songs](https://www.activeloop.ai/resources/3-ways-to-build-a-recommendation-engine-for-songs-with-lang-chain/)." + "You can also follow other tutorials such as question answering over any type of data (PDFs, json, csv, text): [chatting with any data](https://www.activeloop.ai/resources/data-chad-an-ai-app-with-lang-chain-deep-lake-to-chat-with-any-data/) stored in Deep Lake, [code understanding](https://www.activeloop.ai/resources/lang-chain-gpt-4-for-code-understanding-twitter-algorithm/), or [question answering over PDFs](https://www.activeloop.ai/resources/ultimate-guide-to-lang-chain-deep-lake-build-chat-gpt-to-answer-questions-on-your-financial-data/), or [recommending songs](https://www.activeloop.ai/resources/3-ways-to-build-a-recommendation-engine-for-songs-with-lang-chain/)." ], "metadata": { "id": "Ol5OkztZqoAW" @@ -391,75 +391,137 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "cPsdluAqqnRH", - "outputId": "e55ab53c-391a-4d24-ba81-9e3b3f03d443" + "outputId": "ea98b189-1436-413f-e242-8f46504210d2" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ - "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", - "Requirement already satisfied: deeplake in /usr/local/lib/python3.10/dist-packages (3.5.2)\n", - "Requirement already satisfied: langchain in /usr/local/lib/python3.10/dist-packages (0.0.176)\n", - "Requirement already satisfied: openai in /usr/local/lib/python3.10/dist-packages (0.27.7)\n", - "Requirement already satisfied: tiktoken in /usr/local/lib/python3.10/dist-packages (0.4.0)\n", - "Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from deeplake) (1.22.4)\n", - "Requirement already satisfied: pillow in /usr/local/lib/python3.10/dist-packages (from deeplake) (8.4.0)\n", - "Requirement already satisfied: boto3 in /usr/local/lib/python3.10/dist-packages (from deeplake) (1.26.76)\n", - "Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from deeplake) (8.1.3)\n", - "Requirement already satisfied: pathos in /usr/local/lib/python3.10/dist-packages (from deeplake) (0.3.0)\n", - "Requirement already satisfied: humbug>=0.3.1 in /usr/local/lib/python3.10/dist-packages (from deeplake) (0.3.1)\n", - "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from deeplake) (4.65.0)\n", - "Requirement already satisfied: numcodecs in /usr/local/lib/python3.10/dist-packages (from deeplake) (0.11.0)\n", - "Requirement already satisfied: pyjwt in /usr/local/lib/python3.10/dist-packages (from deeplake) (2.7.0)\n", - "Requirement already satisfied: aioboto3>=10.4.0 in /usr/local/lib/python3.10/dist-packages (from deeplake) (11.2.0)\n", - "Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.10/dist-packages (from deeplake) (1.5.6)\n", - "Requirement already satisfied: PyYAML>=5.4.1 in /usr/local/lib/python3.10/dist-packages (from langchain) (6.0)\n", - "Requirement already satisfied: SQLAlchemy<3,>=1.4 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.0.10)\n", - "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in /usr/local/lib/python3.10/dist-packages (from langchain) (3.8.4)\n", - "Requirement already satisfied: async-timeout<5.0.0,>=4.0.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (4.0.2)\n", - "Requirement already satisfied: dataclasses-json<0.6.0,>=0.5.7 in /usr/local/lib/python3.10/dist-packages (from langchain) (0.5.7)\n", - "Requirement already satisfied: numexpr<3.0.0,>=2.8.4 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.8.4)\n", - "Requirement already satisfied: openapi-schema-pydantic<2.0,>=1.2 in /usr/local/lib/python3.10/dist-packages (from langchain) (1.2.4)\n", - "Requirement already satisfied: pydantic<2,>=1 in /usr/local/lib/python3.10/dist-packages (from langchain) (1.10.7)\n", - "Requirement already satisfied: requests<3,>=2 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.27.1)\n", - "Requirement already satisfied: tenacity<9.0.0,>=8.1.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (8.2.2)\n", - "Requirement already satisfied: regex>=2022.1.18 in /usr/local/lib/python3.10/dist-packages (from tiktoken) (2022.10.31)\n", - "Requirement already satisfied: aiobotocore[boto3]==2.5.0 in /usr/local/lib/python3.10/dist-packages (from aioboto3>=10.4.0->deeplake) (2.5.0)\n", - "Requirement already satisfied: botocore<1.29.77,>=1.29.76 in /usr/local/lib/python3.10/dist-packages (from aiobotocore[boto3]==2.5.0->aioboto3>=10.4.0->deeplake) (1.29.76)\n", - "Requirement already satisfied: wrapt>=1.10.10 in /usr/local/lib/python3.10/dist-packages (from aiobotocore[boto3]==2.5.0->aioboto3>=10.4.0->deeplake) (1.14.1)\n", - "Requirement already satisfied: aioitertools>=0.5.1 in /usr/local/lib/python3.10/dist-packages (from aiobotocore[boto3]==2.5.0->aioboto3>=10.4.0->deeplake) (0.11.0)\n", - "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (23.1.0)\n", - "Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (2.0.12)\n", + "Collecting deeplake\n", + " Downloading deeplake-3.7.1.tar.gz (554 kB)\n", + "\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/554.7 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[91m━━━━━━━━\u001b[0m\u001b[91m╸\u001b[0m\u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m122.9/554.7 kB\u001b[0m \u001b[31m3.7 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m554.7/554.7 kB\u001b[0m \u001b[31m8.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n", + " Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n", + " Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", + "Collecting langchain\n", + " Downloading langchain-0.0.304-py3-none-any.whl (1.7 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.7/1.7 MB\u001b[0m \u001b[31m54.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting openai\n", + " Downloading openai-0.28.1-py3-none-any.whl (76 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.0/77.0 kB\u001b[0m \u001b[31m7.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting tiktoken\n", + " Downloading tiktoken-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m64.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from deeplake) (1.23.5)\n", + "Requirement already satisfied: pillow in /usr/local/lib/python3.10/dist-packages (from deeplake) (9.4.0)\n", + "Collecting boto3 (from deeplake)\n", + " Downloading boto3-1.28.56-py3-none-any.whl (135 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m135.8/135.8 kB\u001b[0m \u001b[31m11.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from deeplake) (8.1.7)\n", + "Collecting pathos (from deeplake)\n", + " Downloading pathos-0.3.1-py3-none-any.whl (82 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m82.1/82.1 kB\u001b[0m \u001b[31m8.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting humbug>=0.3.1 (from deeplake)\n", + " Downloading humbug-0.3.2-py3-none-any.whl (15 kB)\n", + "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from deeplake) (4.66.1)\n", + "Collecting numcodecs (from deeplake)\n", + " Downloading numcodecs-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.7 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m6.7/6.7 MB\u001b[0m \u001b[31m90.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: pyjwt in /usr/lib/python3/dist-packages (from deeplake) (2.3.0)\n", + "Collecting aioboto3>=10.4.0 (from deeplake)\n", + " Downloading aioboto3-11.3.0-py3-none-any.whl (32 kB)\n", + "Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.10/dist-packages (from deeplake) (1.5.7)\n", + "Requirement already satisfied: PyYAML>=5.3 in /usr/local/lib/python3.10/dist-packages (from langchain) (6.0.1)\n", + "Requirement already satisfied: SQLAlchemy<3,>=1.4 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.0.20)\n", + "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in /usr/local/lib/python3.10/dist-packages (from langchain) (3.8.5)\n", + "Requirement already satisfied: anyio<4.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (3.7.1)\n", + "Requirement already satisfied: async-timeout<5.0.0,>=4.0.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (4.0.3)\n", + "Collecting dataclasses-json<0.7,>=0.5.7 (from langchain)\n", + " Downloading dataclasses_json-0.6.1-py3-none-any.whl (27 kB)\n", + "Collecting jsonpatch<2.0,>=1.33 (from langchain)\n", + " Downloading jsonpatch-1.33-py2.py3-none-any.whl (12 kB)\n", + "Collecting langsmith<0.1.0,>=0.0.38 (from langchain)\n", + " Downloading langsmith-0.0.41-py3-none-any.whl (39 kB)\n", + "Requirement already satisfied: numexpr<3.0.0,>=2.8.4 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.8.5)\n", + "Requirement already satisfied: pydantic<3,>=1 in /usr/local/lib/python3.10/dist-packages (from langchain) (1.10.12)\n", + "Requirement already satisfied: requests<3,>=2 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.31.0)\n", + "Requirement already satisfied: tenacity<9.0.0,>=8.1.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (8.2.3)\n", + "Requirement already satisfied: regex>=2022.1.18 in /usr/local/lib/python3.10/dist-packages (from tiktoken) (2023.6.3)\n", + "Collecting aiobotocore[boto3]==2.6.0 (from aioboto3>=10.4.0->deeplake)\n", + " Downloading aiobotocore-2.6.0-py3-none-any.whl (73 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.4/73.4 kB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting botocore<1.31.18,>=1.31.17 (from aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake)\n", + " Downloading botocore-1.31.17-py3-none-any.whl (11.1 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.1/11.1 MB\u001b[0m \u001b[31m89.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: wrapt<2.0.0,>=1.10.10 in /usr/local/lib/python3.10/dist-packages (from aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake) (1.15.0)\n", + "Collecting aioitertools<1.0.0,>=0.5.1 (from aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake)\n", + " Downloading aioitertools-0.11.0-py3-none-any.whl (23 kB)\n", + "Collecting boto3 (from deeplake)\n", + " Downloading boto3-1.28.17-py3-none-any.whl (135 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m135.8/135.8 kB\u001b[0m \u001b[31m12.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (23.1.0)\n", + "Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (3.2.0)\n", "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (6.0.4)\n", "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.9.2)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.3.3)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.4.0)\n", "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.3.1)\n", - "Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from boto3->deeplake) (1.0.1)\n", - "Requirement already satisfied: s3transfer<0.7.0,>=0.6.0 in /usr/local/lib/python3.10/dist-packages (from boto3->deeplake) (0.6.1)\n", - "Requirement already satisfied: marshmallow<4.0.0,>=3.3.0 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain) (3.19.0)\n", - "Requirement already satisfied: marshmallow-enum<2.0.0,>=1.5.1 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain) (1.5.1)\n", - "Requirement already satisfied: typing-inspect>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain) (0.8.0)\n", - "Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<2,>=1->langchain) (4.5.0)\n", - "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (1.26.15)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (2022.12.7)\n", - "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (3.4)\n", + "Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.10/dist-packages (from anyio<4.0->langchain) (3.4)\n", + "Requirement already satisfied: sniffio>=1.1 in /usr/local/lib/python3.10/dist-packages (from anyio<4.0->langchain) (1.3.0)\n", + "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<4.0->langchain) (1.1.3)\n", + "Collecting jmespath<2.0.0,>=0.7.1 (from boto3->deeplake)\n", + " Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)\n", + "Collecting s3transfer<0.7.0,>=0.6.0 (from boto3->deeplake)\n", + " Downloading s3transfer-0.6.2-py3-none-any.whl (79 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m79.8/79.8 kB\u001b[0m \u001b[31m7.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting marshmallow<4.0.0,>=3.18.0 (from dataclasses-json<0.7,>=0.5.7->langchain)\n", + " Downloading marshmallow-3.20.1-py3-none-any.whl (49 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.4/49.4 kB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting typing-inspect<1,>=0.4.0 (from dataclasses-json<0.7,>=0.5.7->langchain)\n", + " Downloading typing_inspect-0.9.0-py3-none-any.whl (8.8 kB)\n", + "Collecting jsonpointer>=1.9 (from jsonpatch<2.0,>=1.33->langchain)\n", + " Downloading jsonpointer-2.4-py2.py3-none-any.whl (7.8 kB)\n", + "Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1->langchain) (4.5.0)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (2.0.4)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (2023.7.22)\n", "Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy<3,>=1.4->langchain) (2.0.2)\n", "Requirement already satisfied: entrypoints in /usr/local/lib/python3.10/dist-packages (from numcodecs->deeplake) (0.4)\n", - "Requirement already satisfied: ppft>=1.7.6.6 in /usr/local/lib/python3.10/dist-packages (from pathos->deeplake) (1.7.6.6)\n", - "Requirement already satisfied: dill>=0.3.6 in /usr/local/lib/python3.10/dist-packages (from pathos->deeplake) (0.3.6)\n", - "Requirement already satisfied: pox>=0.3.2 in /usr/local/lib/python3.10/dist-packages (from pathos->deeplake) (0.3.2)\n", - "Requirement already satisfied: multiprocess>=0.70.14 in /usr/local/lib/python3.10/dist-packages (from pathos->deeplake) (0.70.14)\n", - "Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python3.10/dist-packages (from botocore<1.29.77,>=1.29.76->aiobotocore[boto3]==2.5.0->aioboto3>=10.4.0->deeplake) (2.8.2)\n", - "Requirement already satisfied: packaging>=17.0 in /usr/local/lib/python3.10/dist-packages (from marshmallow<4.0.0,>=3.3.0->dataclasses-json<0.6.0,>=0.5.7->langchain) (23.1)\n", - "Requirement already satisfied: mypy-extensions>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from typing-inspect>=0.4.0->dataclasses-json<0.6.0,>=0.5.7->langchain) (1.0.0)\n", - "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.29.77,>=1.29.76->aiobotocore[boto3]==2.5.0->aioboto3>=10.4.0->deeplake) (1.16.0)\n" + "Collecting ppft>=1.7.6.7 (from pathos->deeplake)\n", + " Downloading ppft-1.7.6.7-py3-none-any.whl (56 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.8/56.8 kB\u001b[0m \u001b[31m5.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting dill>=0.3.7 (from pathos->deeplake)\n", + " Downloading dill-0.3.7-py3-none-any.whl (115 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 kB\u001b[0m \u001b[31m11.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting pox>=0.3.3 (from pathos->deeplake)\n", + " Downloading pox-0.3.3-py3-none-any.whl (29 kB)\n", + "Collecting multiprocess>=0.70.15 (from pathos->deeplake)\n", + " Downloading multiprocess-0.70.15-py310-none-any.whl (134 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.8/134.8 kB\u001b[0m \u001b[31m14.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python3.10/dist-packages (from botocore<1.31.18,>=1.31.17->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake) (2.8.2)\n", + "Collecting urllib3<3,>=1.21.1 (from requests<3,>=2->langchain)\n", + " Downloading urllib3-1.26.16-py2.py3-none-any.whl (143 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m143.1/143.1 kB\u001b[0m \u001b[31m14.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: packaging>=17.0 in /usr/local/lib/python3.10/dist-packages (from marshmallow<4.0.0,>=3.18.0->dataclasses-json<0.7,>=0.5.7->langchain) (23.1)\n", + "Collecting mypy-extensions>=0.3.0 (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain)\n", + " Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)\n", + "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.31.18,>=1.31.17->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake) (1.16.0)\n", + "Building wheels for collected packages: deeplake\n", + " Building wheel for deeplake (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", + " Created wheel for deeplake: filename=deeplake-3.7.1-py3-none-any.whl size=669258 sha256=97419d6c54a06a5ec5041a68ee904b45279c46dc09728e21912072d6087be479\n", + " Stored in directory: /root/.cache/pip/wheels/6c/5a/b2/c1da29595c6a68f8cc2816ad88f1a600e44a00f26f24c7e006\n", + "Successfully built deeplake\n", + "Installing collected packages: urllib3, ppft, pox, numcodecs, mypy-extensions, marshmallow, jsonpointer, jmespath, dill, aioitertools, typing-inspect, multiprocess, jsonpatch, botocore, tiktoken, s3transfer, pathos, openai, langsmith, humbug, dataclasses-json, aiobotocore, langchain, boto3, aioboto3, deeplake\n", + " Attempting uninstall: urllib3\n", + " Found existing installation: urllib3 2.0.4\n", + " Uninstalling urllib3-2.0.4:\n", + " Successfully uninstalled urllib3-2.0.4\n", + "Successfully installed aioboto3-11.3.0 aiobotocore-2.6.0 aioitertools-0.11.0 boto3-1.28.17 botocore-1.31.17 dataclasses-json-0.6.1 deeplake-3.7.1 dill-0.3.7 humbug-0.3.2 jmespath-1.0.1 jsonpatch-1.33 jsonpointer-2.4 langchain-0.0.304 langsmith-0.0.41 marshmallow-3.20.1 multiprocess-0.70.15 mypy-extensions-1.0.0 numcodecs-0.11.0 openai-0.28.1 pathos-0.3.1 pox-0.3.3 ppft-1.7.6.7 s3transfer-0.6.2 tiktoken-0.5.1 typing-inspect-0.9.0 urllib3-1.26.16\n" ] } ], @@ -490,9 +552,9 @@ "base_uri": "https://localhost:8080/" }, "id": "Q_-OiwJzrJ8m", - "outputId": "00a24254-42d1-4d8b-92ec-7b6babd3a930" + "outputId": "a87bbcd4-5670-4a5f-eb2c-ba697e67e2ab" }, - "execution_count": null, + "execution_count": 2, "outputs": [ { "name": "stdout", @@ -526,15 +588,29 @@ "base_uri": "https://localhost:8080/" }, "id": "cIj5g4smrwOm", - "outputId": "3d6b7c6a-fb40-41b3-c875-1579b7e1e47c" + "outputId": "ea01eaf0-c9e5-41fe-f904-7ae73898be31" }, - "execution_count": null, + "execution_count": 3, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "-" + "/" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Opening dataset in read-only mode as you don't have write permissions.\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "|" ] }, { @@ -571,7 +647,7 @@ "output_type": "stream", "name": "stderr", "text": [ - "\r \r\r \r" + "\r \r\r\r" ] } ] @@ -595,9 +671,9 @@ "base_uri": "https://localhost:8080/" }, "id": "IWPYDrtUHPEr", - "outputId": "82329129-fcd4-43b7-e498-bd3e006d32eb" + "outputId": "c10a8ff2-0b59-47ed-f93c-7e953747c137" }, - "execution_count": null, + "execution_count": 4, "outputs": [ { "output_type": "execute_result", @@ -609,7 +685,7 @@ ] }, "metadata": {}, - "execution_count": 27 + "execution_count": 4 } ] }, @@ -631,7 +707,7 @@ "metadata": { "id": "Klobw6_T257K" }, - "execution_count": null, + "execution_count": 5, "outputs": [] }, { @@ -657,21 +733,16 @@ "base_uri": "https://localhost:8080/" }, "id": "ykE3HgSl5mcg", - "outputId": "5a08cd34-369c-4735-826b-2ce39a9ab6b1" + "outputId": "bc0b22cc-12ac-48a1-b101-caa0450df13a" }, - "execution_count": null, + "execution_count": 6, "outputs": [ { "output_type": "stream", - "name": "stdout", + "name": "stderr", "text": [ - "wikipedia-embeddings-deeplake loaded successfully.\n" + "WARNING:langchain.vectorstores.deeplake:Using embedding function is deprecated and will be removed in the future. Please use embedding instead.\n" ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [] } ] }, @@ -706,25 +777,25 @@ "metadata": { "colab": { "base_uri": "https://localhost:8080/", - "height": 240, + "height": 275, "referenced_widgets": [ - "412cdebd7786475b990851f82d0b6ad3", - "bf2a79f0685b4f539854c1b6a0b536cf", - "fe4fdc0681724ceaa73904f459f7b870", - "11c779eb13154d6c9056abc64c7d9b58", - "f32ec3f5376e43479579478b1a3ba1ae", - "76057b03fb3d4954873f108d02abadd5", - "a09ed4a8294946a1809fb2542424b4eb", - "c8142883000a48159003babd190b2c31", - "9558945372da4f93a016f7fd6b4892d9", - "8f3b8cdbda77422ba37dbffb5ca4b010", - "d2e5189d38e34963bb54b57e9e9e873b" + "e6fbf36f17aa48ab9438e5761b0401dd", + "5201df20cba84fb3b81ae4d53e882fc8", + "27c0bb794fba475ea32cd41b16378227", + "c35c752ec6474d89812b3482d33f6238", + "1f0b742990134059b7697733c5f1ab8c", + "d4a9c77f01094292aab3c78a4ccf128a", + "abe2881cfa9d4b4782efe881c7dee10b", + "cf09f50ca94248008c240d06e40c220c", + "7d0289d710aa4b43abd0cdf90b0161fc", + "1391cd423ed24c4badebed8b67a86d0b", + "32edd96788a948f8adc487687378dd26" ] }, "id": "hFJTvNGE53lS", - "outputId": "2801750a-9925-4c90-f802-6899b2613924" + "outputId": "955de5e4-c7c3-42cb-ff3c-b3cab1aec402" }, - "execution_count": null, + "execution_count": 7, "outputs": [ { "output_type": "display_data", @@ -735,7 +806,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "412cdebd7786475b990851f82d0b6ad3" + "model_id": "e6fbf36f17aa48ab9438e5761b0401dd" } }, "metadata": {} @@ -745,28 +816,31 @@ "name": "stderr", "text": [ "\n", - "Evaluating ingest: 0%| | 0/1 [00:00 Date: Mon, 2 Oct 2023 10:03:24 +0530 Subject: [PATCH 3/3] fix deprecation msg + hide installation output --- .../deeplake/deeplake_langchain_qa.ipynb | 229 ++++-------------- 1 file changed, 50 insertions(+), 179 deletions(-) diff --git a/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb b/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb index 97fb135d40..71781f82cc 100644 --- a/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb +++ b/examples/vector_databases/deeplake/deeplake_langchain_qa.ipynb @@ -14,7 +14,7 @@ }, "widgets": { "application/vnd.jupyter.widget-state+json": { - "e6fbf36f17aa48ab9438e5761b0401dd": { + "30a05f9f55ae454ba75137634896e82a": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", @@ -29,14 +29,14 @@ "_view_name": "HBoxView", "box_style": "", "children": [ - "IPY_MODEL_5201df20cba84fb3b81ae4d53e882fc8", - "IPY_MODEL_27c0bb794fba475ea32cd41b16378227", - "IPY_MODEL_c35c752ec6474d89812b3482d33f6238" + "IPY_MODEL_0add33db728844a59c1ffa53e18fab98", + "IPY_MODEL_26bf0f01ac414ab0b0da34971ba8cbdf", + "IPY_MODEL_b595729257c34311a1c21b103a20bbb8" ], - "layout": "IPY_MODEL_1f0b742990134059b7697733c5f1ab8c" + "layout": "IPY_MODEL_6a75dce7a6b84148a0515e30f116ee07" } }, - "5201df20cba84fb3b81ae4d53e882fc8": { + "0add33db728844a59c1ffa53e18fab98": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", @@ -51,13 +51,13 @@ "_view_name": "HTMLView", "description": "", "description_tooltip": null, - "layout": "IPY_MODEL_d4a9c77f01094292aab3c78a4ccf128a", + "layout": "IPY_MODEL_1dbe1466e8ba47b1898864ca5aa22f30", "placeholder": "​", - "style": "IPY_MODEL_abe2881cfa9d4b4782efe881c7dee10b", + "style": "IPY_MODEL_90c56b9af48d480b93c027032e44c9dd", "value": "100%" } }, - "27c0bb794fba475ea32cd41b16378227": { + "26bf0f01ac414ab0b0da34971ba8cbdf": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", @@ -73,15 +73,15 @@ "bar_style": "success", "description": "", "description_tooltip": null, - "layout": "IPY_MODEL_cf09f50ca94248008c240d06e40c220c", + "layout": "IPY_MODEL_06099626b6e34bf6acf06e53673d08e7", "max": 1, "min": 0, "orientation": "horizontal", - "style": "IPY_MODEL_7d0289d710aa4b43abd0cdf90b0161fc", + "style": "IPY_MODEL_b8af7a2bffad44cea5264191b5079995", "value": 1 } }, - "c35c752ec6474d89812b3482d33f6238": { + "b595729257c34311a1c21b103a20bbb8": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", @@ -96,13 +96,13 @@ "_view_name": "HTMLView", "description": "", "description_tooltip": null, - "layout": "IPY_MODEL_1391cd423ed24c4badebed8b67a86d0b", + "layout": "IPY_MODEL_d397a65b169647588cf2eaf8342dde5e", "placeholder": "​", - "style": "IPY_MODEL_32edd96788a948f8adc487687378dd26", - "value": " 1/1 [00:03<00:00, 3.34s/it]" + "style": "IPY_MODEL_2f9e6758a17441359021a6b66cff1dea", + "value": " 1/1 [00:04<00:00, 4.45s/it]" } }, - "1f0b742990134059b7697733c5f1ab8c": { + "6a75dce7a6b84148a0515e30f116ee07": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", @@ -154,7 +154,7 @@ "width": null } }, - "d4a9c77f01094292aab3c78a4ccf128a": { + "1dbe1466e8ba47b1898864ca5aa22f30": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", @@ -206,7 +206,7 @@ "width": null } }, - "abe2881cfa9d4b4782efe881c7dee10b": { + "90c56b9af48d480b93c027032e44c9dd": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", @@ -221,7 +221,7 @@ "description_width": "" } }, - "cf09f50ca94248008c240d06e40c220c": { + "06099626b6e34bf6acf06e53673d08e7": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", @@ -273,7 +273,7 @@ "width": null } }, - "7d0289d710aa4b43abd0cdf90b0161fc": { + "b8af7a2bffad44cea5264191b5079995": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", @@ -289,7 +289,7 @@ "description_width": "" } }, - "1391cd423ed24c4badebed8b67a86d0b": { + "d397a65b169647588cf2eaf8342dde5e": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", @@ -341,7 +341,7 @@ "width": null } }, - "32edd96788a948f8adc487687378dd26": { + "2f9e6758a17441359021a6b66cff1dea": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", @@ -391,140 +391,11 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "cPsdluAqqnRH", - "outputId": "ea98b189-1436-413f-e242-8f46504210d2" + "id": "cPsdluAqqnRH" }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Collecting deeplake\n", - " Downloading deeplake-3.7.1.tar.gz (554 kB)\n", - "\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/554.7 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[91m━━━━━━━━\u001b[0m\u001b[91m╸\u001b[0m\u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m122.9/554.7 kB\u001b[0m \u001b[31m3.7 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m554.7/554.7 kB\u001b[0m \u001b[31m8.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25h Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n", - " Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n", - " Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", - "Collecting langchain\n", - " Downloading langchain-0.0.304-py3-none-any.whl (1.7 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.7/1.7 MB\u001b[0m \u001b[31m54.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting openai\n", - " Downloading openai-0.28.1-py3-none-any.whl (76 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.0/77.0 kB\u001b[0m \u001b[31m7.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting tiktoken\n", - " Downloading tiktoken-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m64.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from deeplake) (1.23.5)\n", - "Requirement already satisfied: pillow in /usr/local/lib/python3.10/dist-packages (from deeplake) (9.4.0)\n", - "Collecting boto3 (from deeplake)\n", - " Downloading boto3-1.28.56-py3-none-any.whl (135 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m135.8/135.8 kB\u001b[0m \u001b[31m11.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from deeplake) (8.1.7)\n", - "Collecting pathos (from deeplake)\n", - " Downloading pathos-0.3.1-py3-none-any.whl (82 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m82.1/82.1 kB\u001b[0m \u001b[31m8.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting humbug>=0.3.1 (from deeplake)\n", - " Downloading humbug-0.3.2-py3-none-any.whl (15 kB)\n", - "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from deeplake) (4.66.1)\n", - "Collecting numcodecs (from deeplake)\n", - " Downloading numcodecs-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.7 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m6.7/6.7 MB\u001b[0m \u001b[31m90.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: pyjwt in /usr/lib/python3/dist-packages (from deeplake) (2.3.0)\n", - "Collecting aioboto3>=10.4.0 (from deeplake)\n", - " Downloading aioboto3-11.3.0-py3-none-any.whl (32 kB)\n", - "Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.10/dist-packages (from deeplake) (1.5.7)\n", - "Requirement already satisfied: PyYAML>=5.3 in /usr/local/lib/python3.10/dist-packages (from langchain) (6.0.1)\n", - "Requirement already satisfied: SQLAlchemy<3,>=1.4 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.0.20)\n", - "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in /usr/local/lib/python3.10/dist-packages (from langchain) (3.8.5)\n", - "Requirement already satisfied: anyio<4.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (3.7.1)\n", - "Requirement already satisfied: async-timeout<5.0.0,>=4.0.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (4.0.3)\n", - "Collecting dataclasses-json<0.7,>=0.5.7 (from langchain)\n", - " Downloading dataclasses_json-0.6.1-py3-none-any.whl (27 kB)\n", - "Collecting jsonpatch<2.0,>=1.33 (from langchain)\n", - " Downloading jsonpatch-1.33-py2.py3-none-any.whl (12 kB)\n", - "Collecting langsmith<0.1.0,>=0.0.38 (from langchain)\n", - " Downloading langsmith-0.0.41-py3-none-any.whl (39 kB)\n", - "Requirement already satisfied: numexpr<3.0.0,>=2.8.4 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.8.5)\n", - "Requirement already satisfied: pydantic<3,>=1 in /usr/local/lib/python3.10/dist-packages (from langchain) (1.10.12)\n", - "Requirement already satisfied: requests<3,>=2 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.31.0)\n", - "Requirement already satisfied: tenacity<9.0.0,>=8.1.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (8.2.3)\n", - "Requirement already satisfied: regex>=2022.1.18 in /usr/local/lib/python3.10/dist-packages (from tiktoken) (2023.6.3)\n", - "Collecting aiobotocore[boto3]==2.6.0 (from aioboto3>=10.4.0->deeplake)\n", - " Downloading aiobotocore-2.6.0-py3-none-any.whl (73 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.4/73.4 kB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting botocore<1.31.18,>=1.31.17 (from aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake)\n", - " Downloading botocore-1.31.17-py3-none-any.whl (11.1 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.1/11.1 MB\u001b[0m \u001b[31m89.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: wrapt<2.0.0,>=1.10.10 in /usr/local/lib/python3.10/dist-packages (from aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake) (1.15.0)\n", - "Collecting aioitertools<1.0.0,>=0.5.1 (from aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake)\n", - " Downloading aioitertools-0.11.0-py3-none-any.whl (23 kB)\n", - "Collecting boto3 (from deeplake)\n", - " Downloading boto3-1.28.17-py3-none-any.whl (135 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m135.8/135.8 kB\u001b[0m \u001b[31m12.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (23.1.0)\n", - "Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (3.2.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (6.0.4)\n", - "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.9.2)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.4.0)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.3.1)\n", - "Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.10/dist-packages (from anyio<4.0->langchain) (3.4)\n", - "Requirement already satisfied: sniffio>=1.1 in /usr/local/lib/python3.10/dist-packages (from anyio<4.0->langchain) (1.3.0)\n", - "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<4.0->langchain) (1.1.3)\n", - "Collecting jmespath<2.0.0,>=0.7.1 (from boto3->deeplake)\n", - " Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)\n", - "Collecting s3transfer<0.7.0,>=0.6.0 (from boto3->deeplake)\n", - " Downloading s3transfer-0.6.2-py3-none-any.whl (79 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m79.8/79.8 kB\u001b[0m \u001b[31m7.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting marshmallow<4.0.0,>=3.18.0 (from dataclasses-json<0.7,>=0.5.7->langchain)\n", - " Downloading marshmallow-3.20.1-py3-none-any.whl (49 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.4/49.4 kB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting typing-inspect<1,>=0.4.0 (from dataclasses-json<0.7,>=0.5.7->langchain)\n", - " Downloading typing_inspect-0.9.0-py3-none-any.whl (8.8 kB)\n", - "Collecting jsonpointer>=1.9 (from jsonpatch<2.0,>=1.33->langchain)\n", - " Downloading jsonpointer-2.4-py2.py3-none-any.whl (7.8 kB)\n", - "Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1->langchain) (4.5.0)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (2.0.4)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (2023.7.22)\n", - "Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy<3,>=1.4->langchain) (2.0.2)\n", - "Requirement already satisfied: entrypoints in /usr/local/lib/python3.10/dist-packages (from numcodecs->deeplake) (0.4)\n", - "Collecting ppft>=1.7.6.7 (from pathos->deeplake)\n", - " Downloading ppft-1.7.6.7-py3-none-any.whl (56 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.8/56.8 kB\u001b[0m \u001b[31m5.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting dill>=0.3.7 (from pathos->deeplake)\n", - " Downloading dill-0.3.7-py3-none-any.whl (115 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 kB\u001b[0m \u001b[31m11.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting pox>=0.3.3 (from pathos->deeplake)\n", - " Downloading pox-0.3.3-py3-none-any.whl (29 kB)\n", - "Collecting multiprocess>=0.70.15 (from pathos->deeplake)\n", - " Downloading multiprocess-0.70.15-py310-none-any.whl (134 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.8/134.8 kB\u001b[0m \u001b[31m14.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python3.10/dist-packages (from botocore<1.31.18,>=1.31.17->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake) (2.8.2)\n", - "Collecting urllib3<3,>=1.21.1 (from requests<3,>=2->langchain)\n", - " Downloading urllib3-1.26.16-py2.py3-none-any.whl (143 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m143.1/143.1 kB\u001b[0m \u001b[31m14.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: packaging>=17.0 in /usr/local/lib/python3.10/dist-packages (from marshmallow<4.0.0,>=3.18.0->dataclasses-json<0.7,>=0.5.7->langchain) (23.1)\n", - "Collecting mypy-extensions>=0.3.0 (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain)\n", - " Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)\n", - "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.31.18,>=1.31.17->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake) (1.16.0)\n", - "Building wheels for collected packages: deeplake\n", - " Building wheel for deeplake (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", - " Created wheel for deeplake: filename=deeplake-3.7.1-py3-none-any.whl size=669258 sha256=97419d6c54a06a5ec5041a68ee904b45279c46dc09728e21912072d6087be479\n", - " Stored in directory: /root/.cache/pip/wheels/6c/5a/b2/c1da29595c6a68f8cc2816ad88f1a600e44a00f26f24c7e006\n", - "Successfully built deeplake\n", - "Installing collected packages: urllib3, ppft, pox, numcodecs, mypy-extensions, marshmallow, jsonpointer, jmespath, dill, aioitertools, typing-inspect, multiprocess, jsonpatch, botocore, tiktoken, s3transfer, pathos, openai, langsmith, humbug, dataclasses-json, aiobotocore, langchain, boto3, aioboto3, deeplake\n", - " Attempting uninstall: urllib3\n", - " Found existing installation: urllib3 2.0.4\n", - " Uninstalling urllib3-2.0.4:\n", - " Successfully uninstalled urllib3-2.0.4\n", - "Successfully installed aioboto3-11.3.0 aiobotocore-2.6.0 aioitertools-0.11.0 boto3-1.28.17 botocore-1.31.17 dataclasses-json-0.6.1 deeplake-3.7.1 dill-0.3.7 humbug-0.3.2 jmespath-1.0.1 jsonpatch-1.33 jsonpointer-2.4 langchain-0.0.304 langsmith-0.0.41 marshmallow-3.20.1 multiprocess-0.70.15 mypy-extensions-1.0.0 numcodecs-0.11.0 openai-0.28.1 pathos-0.3.1 pox-0.3.3 ppft-1.7.6.7 s3transfer-0.6.2 tiktoken-0.5.1 typing-inspect-0.9.0 urllib3-1.26.16\n" - ] - } - ], + "outputs": [], "source": [ "!pip install deeplake langchain openai tiktoken" ] @@ -552,7 +423,7 @@ "base_uri": "https://localhost:8080/" }, "id": "Q_-OiwJzrJ8m", - "outputId": "a87bbcd4-5670-4a5f-eb2c-ba697e67e2ab" + "outputId": "b11b0d5c-cbd4-469d-95d1-fcd7149bd493" }, "execution_count": 2, "outputs": [ @@ -588,7 +459,7 @@ "base_uri": "https://localhost:8080/" }, "id": "cIj5g4smrwOm", - "outputId": "ea01eaf0-c9e5-41fe-f904-7ae73898be31" + "outputId": "6315bd53-8a2f-40ef-b2f5-2687c90b2231" }, "execution_count": 3, "outputs": [ @@ -596,7 +467,7 @@ "output_type": "stream", "name": "stderr", "text": [ - "/" + "\\" ] }, { @@ -610,7 +481,7 @@ "output_type": "stream", "name": "stderr", "text": [ - "|" + "-" ] }, { @@ -671,7 +542,7 @@ "base_uri": "https://localhost:8080/" }, "id": "IWPYDrtUHPEr", - "outputId": "c10a8ff2-0b59-47ed-f93c-7e953747c137" + "outputId": "91e1b13e-abd0-4709-f65c-87986e90181a" }, "execution_count": 4, "outputs": [ @@ -726,14 +597,14 @@ "from langchain.vectorstores import DeepLake\n", "\n", "embedding = OpenAIEmbeddings(model=\"text-embedding-ada-002\")\n", - "db = DeepLake(dataset_path, embedding_function=embedding, overwrite=True)" + "db = DeepLake(dataset_path, embedding=embedding, overwrite=True)" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "ykE3HgSl5mcg", - "outputId": "bc0b22cc-12ac-48a1-b101-caa0450df13a" + "outputId": "dde4d6bb-6c82-473e-f37d-3f03a358ee8b" }, "execution_count": 6, "outputs": [ @@ -741,7 +612,7 @@ "output_type": "stream", "name": "stderr", "text": [ - "WARNING:langchain.vectorstores.deeplake:Using embedding function is deprecated and will be removed in the future. Please use embedding instead.\n" + "\r\r\r\r" ] } ] @@ -779,21 +650,21 @@ "base_uri": "https://localhost:8080/", "height": 275, "referenced_widgets": [ - "e6fbf36f17aa48ab9438e5761b0401dd", - "5201df20cba84fb3b81ae4d53e882fc8", - "27c0bb794fba475ea32cd41b16378227", - "c35c752ec6474d89812b3482d33f6238", - "1f0b742990134059b7697733c5f1ab8c", - "d4a9c77f01094292aab3c78a4ccf128a", - "abe2881cfa9d4b4782efe881c7dee10b", - "cf09f50ca94248008c240d06e40c220c", - "7d0289d710aa4b43abd0cdf90b0161fc", - "1391cd423ed24c4badebed8b67a86d0b", - "32edd96788a948f8adc487687378dd26" + "30a05f9f55ae454ba75137634896e82a", + "0add33db728844a59c1ffa53e18fab98", + "26bf0f01ac414ab0b0da34971ba8cbdf", + "b595729257c34311a1c21b103a20bbb8", + "6a75dce7a6b84148a0515e30f116ee07", + "1dbe1466e8ba47b1898864ca5aa22f30", + "90c56b9af48d480b93c027032e44c9dd", + "06099626b6e34bf6acf06e53673d08e7", + "b8af7a2bffad44cea5264191b5079995", + "d397a65b169647588cf2eaf8342dde5e", + "2f9e6758a17441359021a6b66cff1dea" ] }, "id": "hFJTvNGE53lS", - "outputId": "955de5e4-c7c3-42cb-ff3c-b3cab1aec402" + "outputId": "200e3808-1309-4520-9b42-6b59cfc506e6" }, "execution_count": 7, "outputs": [ @@ -806,7 +677,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "e6fbf36f17aa48ab9438e5761b0401dd" + "model_id": "30a05f9f55ae454ba75137634896e82a" } }, "metadata": {} @@ -817,9 +688,9 @@ "text": [ "\n", "creating embeddings: 0%| | 0/1 [00:00