From b23ec36340fd743321c6c3c9b3ea8eeaced3fe79 Mon Sep 17 00:00:00 2001 From: raghavdixit99 Date: Fri, 1 Mar 2024 20:30:54 -0500 Subject: [PATCH] formatting --- examples/imagebind_demo/main.ipynb | 116 +++++++++++++++++++++-------- 1 file changed, 86 insertions(+), 30 deletions(-) diff --git a/examples/imagebind_demo/main.ipynb b/examples/imagebind_demo/main.ipynb index d24d195..8f66c8a 100644 --- a/examples/imagebind_demo/main.ipynb +++ b/examples/imagebind_demo/main.ipynb @@ -11,47 +11,103 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!git clone https://github.com/lancedb/vectordb-recipes.git \n", + "%cd vectordb-recipes/examples/imagebind_demo\n", + "%pip install -r requirements.txt" + ] + }, + { + "cell_type": "code", + "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "zsh:1: /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/bin/pip: bad interpreter: /Users/raghavdixit/Desktop/open_source/imagebind_demo/test_inputs/.env/bin/python3.10: no such file or directory\n", - "\u001b[33mWARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/certifi-2024.2.2.dist-info due to invalid metadata entry 'name'\u001b[0m\u001b[33m\n", - "\u001b[0mRequirement already satisfied: google-api-python-client in /opt/homebrew/lib/python3.11/site-packages (2.120.0)\n", - "Requirement already satisfied: httplib2<1.dev0,>=0.15.0 in /opt/homebrew/lib/python3.11/site-packages (from google-api-python-client) (0.22.0)\n", - "Requirement already satisfied: google-auth<3.0.0.dev0,>=1.19.0 in /opt/homebrew/lib/python3.11/site-packages (from google-api-python-client) (2.28.1)\n", - "Requirement already satisfied: google-auth-httplib2>=0.1.0 in /opt/homebrew/lib/python3.11/site-packages (from google-api-python-client) (0.2.0)\n", - "Requirement already satisfied: google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0.dev0,>=1.31.5 in /opt/homebrew/lib/python3.11/site-packages (from google-api-python-client) (2.17.1)\n", - "Requirement already satisfied: uritemplate<5,>=3.0.1 in /opt/homebrew/lib/python3.11/site-packages (from google-api-python-client) (4.1.1)\n", - "Requirement already satisfied: googleapis-common-protos<2.0.dev0,>=1.56.2 in /opt/homebrew/lib/python3.11/site-packages (from google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0.dev0,>=1.31.5->google-api-python-client) (1.62.0)\n", - "Requirement already satisfied: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0.dev0,>=3.19.5 in /opt/homebrew/lib/python3.11/site-packages (from google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0.dev0,>=1.31.5->google-api-python-client) (4.25.2)\n", - "Requirement already satisfied: requests<3.0.0.dev0,>=2.18.0 in /opt/homebrew/lib/python3.11/site-packages (from google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0.dev0,>=1.31.5->google-api-python-client) (2.31.0)\n", - "Requirement already satisfied: cachetools<6.0,>=2.0.0 in /opt/homebrew/lib/python3.11/site-packages (from google-auth<3.0.0.dev0,>=1.19.0->google-api-python-client) (5.3.2)\n", - "Requirement already satisfied: pyasn1-modules>=0.2.1 in /opt/homebrew/lib/python3.11/site-packages (from google-auth<3.0.0.dev0,>=1.19.0->google-api-python-client) (0.3.0)\n", - "Requirement already satisfied: rsa<5,>=3.1.4 in /opt/homebrew/lib/python3.11/site-packages (from google-auth<3.0.0.dev0,>=1.19.0->google-api-python-client) (4.9)\n", - "Requirement already satisfied: pyparsing!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3,<4,>=2.4.2 in /opt/homebrew/lib/python3.11/site-packages (from httplib2<1.dev0,>=0.15.0->google-api-python-client) (3.1.1)\n", - "Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /opt/homebrew/lib/python3.11/site-packages (from pyasn1-modules>=0.2.1->google-auth<3.0.0.dev0,>=1.19.0->google-api-python-client) (0.5.1)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /opt/homebrew/lib/python3.11/site-packages (from requests<3.0.0.dev0,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0.dev0,>=1.31.5->google-api-python-client) (3.3.2)\n", - "Requirement already satisfied: idna<4,>=2.5 in /opt/homebrew/lib/python3.11/site-packages (from requests<3.0.0.dev0,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0.dev0,>=1.31.5->google-api-python-client) (3.6)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/homebrew/lib/python3.11/site-packages (from requests<3.0.0.dev0,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0.dev0,>=1.31.5->google-api-python-client) (2.1.0)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /opt/homebrew/lib/python3.11/site-packages (from requests<3.0.0.dev0,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0.dev0,>=1.31.5->google-api-python-client) (2023.11.17)\n", - "\u001b[33mWARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/certifi-2024.2.2.dist-info due to invalid metadata entry 'name'\u001b[0m\u001b[33m\n", - "\u001b[0m" + "Requirement already satisfied: gradio in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (4.19.2)\n", + "Requirement already satisfied: aiofiles<24.0,>=22.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (23.2.1)\n", + "Requirement already satisfied: altair<6.0,>=4.2.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (5.2.0)\n", + "Requirement already satisfied: fastapi in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (0.110.0)\n", + "Requirement already satisfied: ffmpy in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (0.3.2)\n", + "Requirement already satisfied: gradio-client==0.10.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (0.10.1)\n", + "Requirement already satisfied: httpx>=0.24.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (0.27.0)\n", + "Requirement already satisfied: huggingface-hub>=0.19.3 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (0.21.3)\n", + "Requirement already satisfied: importlib-resources<7.0,>=1.3 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (6.1.2)\n", + "Requirement already satisfied: jinja2<4.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (3.1.3)\n", + "Requirement already satisfied: markupsafe~=2.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (2.1.5)\n", + "Requirement already satisfied: matplotlib~=3.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (3.8.3)\n", + "Requirement already satisfied: numpy~=1.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (1.26.4)\n", + "Requirement already satisfied: orjson~=3.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (3.9.15)\n", + "Requirement already satisfied: packaging in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (23.2)\n", + "Requirement already satisfied: pandas<3.0,>=1.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (2.2.1)\n", + "Requirement already satisfied: pillow<11.0,>=8.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (10.2.0)\n", + "Requirement already satisfied: pydantic>=2.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (2.6.3)\n", + "Requirement already satisfied: pydub in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (0.25.1)\n", + "Requirement already satisfied: python-multipart>=0.0.9 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (0.0.9)\n", + "Requirement already satisfied: pyyaml<7.0,>=5.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (6.0.1)\n", + "Requirement already satisfied: ruff>=0.2.2 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (0.3.0)\n", + "Requirement already satisfied: semantic-version~=2.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (2.10.0)\n", + "Requirement already satisfied: tomlkit==0.12.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (0.12.0)\n", + "Requirement already satisfied: typer<1.0,>=0.9 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (0.9.0)\n", + "Requirement already satisfied: typing-extensions~=4.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (4.10.0)\n", + "Requirement already satisfied: uvicorn>=0.14.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio) (0.27.1)\n", + "Requirement already satisfied: fsspec in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio-client==0.10.1->gradio) (2024.2.0)\n", + "Requirement already satisfied: websockets<12.0,>=10.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from gradio-client==0.10.1->gradio) (11.0.3)\n", + "Requirement already satisfied: jsonschema>=3.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (4.21.1)\n", + "Requirement already satisfied: toolz in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.1)\n", + "Requirement already satisfied: anyio in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from httpx>=0.24.1->gradio) (4.3.0)\n", + "Requirement already satisfied: certifi in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from httpx>=0.24.1->gradio) (2024.2.2)\n", + "Requirement already satisfied: httpcore==1.* in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from httpx>=0.24.1->gradio) (1.0.4)\n", + "Requirement already satisfied: idna in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from httpx>=0.24.1->gradio) (3.6)\n", + "Requirement already satisfied: sniffio in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from httpx>=0.24.1->gradio) (1.3.1)\n", + "Requirement already satisfied: h11<0.15,>=0.13 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from httpcore==1.*->httpx>=0.24.1->gradio) (0.14.0)\n", + "Requirement already satisfied: filelock in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (3.13.1)\n", + "Requirement already satisfied: requests in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (2.31.0)\n", + "Requirement already satisfied: tqdm>=4.42.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (4.66.2)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.2.0)\n", + "Requirement already satisfied: cycler>=0.10 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (4.49.0)\n", + "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (3.1.1)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (2.9.0)\n", + "Requirement already satisfied: pytz>=2020.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2024.1)\n", + "Requirement already satisfied: tzdata>=2022.7 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2024.1)\n", + "Requirement already satisfied: annotated-types>=0.4.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (0.6.0)\n", + "Requirement already satisfied: pydantic-core==2.16.3 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (2.16.3)\n", + "Requirement already satisfied: click<9.0.0,>=7.1.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from typer<1.0,>=0.9->typer[all]<1.0,>=0.9->gradio) (8.1.7)\n", + "Requirement already satisfied: colorama<0.5.0,>=0.4.3 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (0.4.6)\n", + "Requirement already satisfied: shellingham<2.0.0,>=1.3.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (1.5.4)\n", + "Requirement already satisfied: rich<14.0.0,>=10.11.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (13.7.1)\n", + "Requirement already satisfied: starlette<0.37.0,>=0.36.3 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from fastapi->gradio) (0.36.3)\n", + "Requirement already satisfied: attrs>=22.2.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.2.0)\n", + "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.12.1)\n", + "Requirement already satisfied: referencing>=0.28.4 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.33.0)\n", + "Requirement already satisfied: rpds-py>=0.7.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.18.0)\n", + "Requirement already satisfied: six>=1.5 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n", + "Requirement already satisfied: markdown-it-py>=2.2.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (3.0.0)\n", + "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (2.17.2)\n", + "Requirement already satisfied: exceptiongroup>=1.0.2 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from anyio->httpx>=0.24.1->gradio) (1.2.0)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (3.3.2)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (2.2.1)\n", + "Requirement already satisfied: mdurl~=0.1 in /Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (0.1.2)\n", + "\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.3.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n" ] } ], "source": [ - "%git clone https://github.com/lancedb/vectordb-recipes.git \n", - "%cd vectordb-recipes/examples/imagebind_demo\n", - "%pip install -r requirements.txt" + "! pip install gradio" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -68,13 +124,13 @@ " warnings.warn(\n", "/Users/raghavdixit/Desktop/open_source/vectordb-recipes_rd/.env/lib/python3.10/site-packages/torchvision/transforms/_transforms_video.py:22: UserWarning: The 'torchvision.transforms._transforms_video' module is deprecated since 0.12 and will be removed in the future. Please use the 'torchvision.transforms' module instead.\n", " warnings.warn(\n", - "Running on local URL: http://127.0.0.1:7860\n", - "Running on public URL: https://fa004aa278890e4e7a.gradio.live\n", + "Running on local URL: http://127.0.0.1:7861\n", + "Running on public URL: https://6de08e25eebb3b3661.gradio.live\n", "\n", "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n", "^C\n", "Keyboard interruption in main thread... closing server.\n", - "Killing tunnel 127.0.0.1:7860 <> https://fa004aa278890e4e7a.gradio.live\n" + "Killing tunnel 127.0.0.1:7861 <> https://6de08e25eebb3b3661.gradio.live\n" ] } ],