{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "1d5d6034",
   "metadata": {},
   "source": [
    "## Part 3: Setting up RAG Example and Validating our Retrieval Pipeline\n",
    "\n",
    "We are ready for the finale, but let's recap:\n",
    "\n",
    "- We started with an example dataset of 5000 images\n",
    "- In the first notebook, we cleaned this up for labelling and used `Llama-3.2-11B` model for labelling\n",
    "- In the second notebook, we cleaned up some hallucinations of the model and pre-processed the descriptions that were synthetically generated\n",
    "\n",
    "\n",
    "Step 3 is to setup a RAG pipeline and profit.\n",
    "\n",
    "We will use [lance-db](https://lancedb.com) since it's open source and Llama and open source go well together 🤝\n",
    "\n",
    "We also love free API credits and [Together](https://www.together.ai) is hosting 11B model for free. For our final demo, we will use their API and validate the same in this example."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "ee4b18be-3bf0-4f7c-8ac5-ef68b7566750",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "#!pip install lancedb rerankers together -q"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "add7aeb6",
   "metadata": {},
   "source": [
    "### Loading the Dataset and Creating Embeddings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "a13b002d-26bc-4fb0-bd08-193163f2a3d7",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import os\n",
    "from together import Together\n",
    "\n",
    "os.environ[\"TOGETHER_API_KEY\"] = \"\"\n",
    "client = Together(api_key=os.environ.get('TOGETHER_API_KEY'))\n",
    "\n",
    "df = pd.read_csv(\"./MM-Demo/final_balanced_sample_dataset.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "e2078d99-959e-4bb6-a702-ff3e31761db2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Filename</th>\n",
       "      <th>Title</th>\n",
       "      <th>Size</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Description</th>\n",
       "      <th>Category</th>\n",
       "      <th>Type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>d7ed1d64-2c65-427f-9ae4-eb4aaa3e2389.jpg</td>\n",
       "      <td>Stylish and Trendy Tank Top with Celestial Design</td>\n",
       "      <td>M</td>\n",
       "      <td>F</td>\n",
       "      <td>This white tank top is a stylish and trendy pi...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5c1b7a77-1fa3-4af8-9722-cd38e45d89da.jpg</td>\n",
       "      <td>Classic White Sweatshirt</td>\n",
       "      <td>M</td>\n",
       "      <td>F</td>\n",
       "      <td>This classic white sweatshirt is a timeless pi...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>b2e084c7-e3a0-4182-8671-b908544a7cf2.jpg</td>\n",
       "      <td>Grey T-shirt</td>\n",
       "      <td>M</td>\n",
       "      <td>Unisex</td>\n",
       "      <td>This is a short-sleeved, crew neck t-shirt tha...</td>\n",
       "      <td>T-Shirt</td>\n",
       "      <td>Casual</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>87846aa9-86cc-404a-af2c-7e8fe941081d.jpg</td>\n",
       "      <td>Long-Sleeved V-Neck Shirt</td>\n",
       "      <td>L</td>\n",
       "      <td>U</td>\n",
       "      <td>A long-sleeved, V-neck shirt with a solid purp...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>04fa06fb-d71a-4293-9804-fe799375a682.jpg</td>\n",
       "      <td>Silver Metallic Buckle Sandals</td>\n",
       "      <td>L</td>\n",
       "      <td>F</td>\n",
       "      <td>These silver metallic buckle sandals feature a...</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>Casual</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                   Filename  \\\n",
       "0  d7ed1d64-2c65-427f-9ae4-eb4aaa3e2389.jpg   \n",
       "1  5c1b7a77-1fa3-4af8-9722-cd38e45d89da.jpg   \n",
       "2  b2e084c7-e3a0-4182-8671-b908544a7cf2.jpg   \n",
       "3  87846aa9-86cc-404a-af2c-7e8fe941081d.jpg   \n",
       "4  04fa06fb-d71a-4293-9804-fe799375a682.jpg   \n",
       "\n",
       "                                               Title Size  Gender  \\\n",
       "0  Stylish and Trendy Tank Top with Celestial Design    M       F   \n",
       "1                           Classic White Sweatshirt    M       F   \n",
       "2                                       Grey T-shirt    M  Unisex   \n",
       "3                          Long-Sleeved V-Neck Shirt    L       U   \n",
       "4                     Silver Metallic Buckle Sandals    L       F   \n",
       "\n",
       "                                         Description Category    Type  \n",
       "0  This white tank top is a stylish and trendy pi...     Tops  Casual  \n",
       "1  This classic white sweatshirt is a timeless pi...     Tops  Casual  \n",
       "2  This is a short-sleeved, crew neck t-shirt tha...  T-Shirt  Casual  \n",
       "3  A long-sleeved, V-neck shirt with a solid purp...     Tops  Casual  \n",
       "4  These silver metallic buckle sandals feature a...    Shoes  Casual  "
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "806b1ab5-e3ca-46ec-851d-85bb4e371795",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'This white tank top is a stylish and trendy piece of clothing that features a captivating celestial design. The design showcases a mesmerizing array of stars, planets, and moons in black and white, creating a visually appealing and eye-catching pattern. The tank top has a relaxed fit with a round neckline and sleeveless design, making it a comfortable and versatile piece that can be worn on its own or layered under a cardigan or jacket. Perfect for a casual day out or a night on the town, this tank top is a must-have for any fashion-conscious woman.'"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"Description\"][0]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "188acbd2",
   "metadata": {},
   "source": [
    "#### Creating Embeddings: \n",
    "\n",
    "We will define a Schema and use `BAAI/bge-small-en-v1.5` embeddings to create our vector embeddings. This is a first step, we can iterate with more embeddings in our final app later. \n",
    "\n",
    "For retrieval, we will embed descriptions of all clothes and use these."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "efec4e5e-3371-435a-8b49-2a4b69d7776c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of empty descriptions: 0\n"
     ]
    }
   ],
   "source": [
    "import lancedb\n",
    "from lancedb.pydantic import LanceModel, Vector\n",
    "from lancedb.embeddings import get_registry\n",
    "from lancedb.rerankers import ColbertReranker\n",
    "from pathlib import Path\n",
    "from PIL import Image\n",
    "import pandas as pd\n",
    "\n",
    "model = get_registry().get(\"sentence-transformers\").create(name=\"BAAI/bge-small-en-v1.5\", device=\"cuda\")\n",
    "\n",
    "class Schema(LanceModel):\n",
    "    Filename: str\n",
    "    Title: str\n",
    "    Size: str\n",
    "    Gender: str\n",
    "    Description: str = model.SourceField()\n",
    "    Category: str\n",
    "    Type: str\n",
    "    vector: Vector(model.ndims()) = model.VectorField()\n",
    "\n",
    "db = lancedb.connect(\"~/.lancedb\")\n",
    "tbl = db.create_table(name=\"clothes\", schema=Schema, mode=\"overwrite\")\n",
    "\n",
    "# Function to clean and convert data types\n",
    "def clean_data(df):\n",
    "    # Convert all columns to string type\n",
    "    for col in df.columns:\n",
    "        df[col] = df[col].astype(str)\n",
    "    \n",
    "    # Remove any rows with NaN values\n",
    "    df = df.dropna()\n",
    "    \n",
    "    return df\n",
    "\n",
    "# Clean the data\n",
    "cleaned_df = clean_data(df)\n",
    "\n",
    "# Convert cleaned DataFrame to list of dictionaries\n",
    "data = cleaned_df.to_dict('records')\n",
    "\n",
    "empty_count = len([d for d in data if d.get('Description', '').strip() == ''])\n",
    "print(f\"Number of empty descriptions: {empty_count}\")\n",
    "\n",
    "# automatically generate vectors\n",
    "tbl.add(data)\n",
    "\n",
    "tbl.search().to_pandas()\n",
    "\n",
    "def show_image_from_response(rs):\n",
    "    names = rs[\"Filename\"].to_list()\n",
    "    return [Image.open(Path(\"archive\") / \"images_compressed\" / name) for name in names]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "e4917d40-3ade-49e5-aaf1-865a87bf50bf",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# automatically generate vectors\n",
    "tbl.add(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "c90f9005-ee3c-44ff-8bfd-b020bd4e6091",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Filename</th>\n",
       "      <th>Title</th>\n",
       "      <th>Size</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Description</th>\n",
       "      <th>Category</th>\n",
       "      <th>Type</th>\n",
       "      <th>vector</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>d7ed1d64-2c65-427f-9ae4-eb4aaa3e2389.jpg</td>\n",
       "      <td>Stylish and Trendy Tank Top with Celestial Design</td>\n",
       "      <td>M</td>\n",
       "      <td>F</td>\n",
       "      <td>This white tank top is a stylish and trendy pi...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.06355423, 0.02385288, 0.03382446, -0.00212...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5c1b7a77-1fa3-4af8-9722-cd38e45d89da.jpg</td>\n",
       "      <td>Classic White Sweatshirt</td>\n",
       "      <td>M</td>\n",
       "      <td>F</td>\n",
       "      <td>This classic white sweatshirt is a timeless pi...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.011691423, 0.049270794, 0.030319242, -0.02...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>b2e084c7-e3a0-4182-8671-b908544a7cf2.jpg</td>\n",
       "      <td>Grey T-shirt</td>\n",
       "      <td>M</td>\n",
       "      <td>Unisex</td>\n",
       "      <td>This is a short-sleeved, crew neck t-shirt tha...</td>\n",
       "      <td>T-Shirt</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.010150914, 0.09637642, -0.0012558334, 0.04...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>87846aa9-86cc-404a-af2c-7e8fe941081d.jpg</td>\n",
       "      <td>Long-Sleeved V-Neck Shirt</td>\n",
       "      <td>L</td>\n",
       "      <td>U</td>\n",
       "      <td>A long-sleeved, V-neck shirt with a solid purp...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.058710814, 0.053951632, -0.047531255, 0.03...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>04fa06fb-d71a-4293-9804-fe799375a682.jpg</td>\n",
       "      <td>Silver Metallic Buckle Sandals</td>\n",
       "      <td>L</td>\n",
       "      <td>F</td>\n",
       "      <td>These silver metallic buckle sandals feature a...</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[0.0123484805, 0.02398385, 0.059779372, -0.006...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>8f576f1a-839d-4fb2-a224-a4700b2d05da.jpg</td>\n",
       "      <td>Orange Long Sleeve T-Shirt</td>\n",
       "      <td>S</td>\n",
       "      <td>U</td>\n",
       "      <td>This long sleeve t-shirt is made of a lightwei...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.016778396, 0.06664105, -0.010597771, 0.052...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>e976a8f6-6731-485f-8a9a-2872a5208818.jpg</td>\n",
       "      <td>Green T-Shirt</td>\n",
       "      <td>L</td>\n",
       "      <td>M</td>\n",
       "      <td>The green t-shirt is a relaxed fit with a V-ne...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[0.015946185, 0.07543863, 0.032447945, 0.00442...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>bbf0d9c7-663d-46d1-a9f8-66e8e5678541.jpg</td>\n",
       "      <td>White Quarter Zip Pullover Top</td>\n",
       "      <td>L</td>\n",
       "      <td>U</td>\n",
       "      <td>This pullover top has a quarter zip closure at...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.05592024, 0.03401515, -0.0057456787, 0.030...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>e25a7faa-7a49-4e72-a7ef-e74427f77784.jpg</td>\n",
       "      <td>Aviator Sunglasses T-Shirt</td>\n",
       "      <td>M</td>\n",
       "      <td>F</td>\n",
       "      <td>This sleeveless red T-shirt features a large b...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.040058654, 0.090077035, -0.020889325, 0.03...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>d995ac1f-fbd0-482c-a308-dafb6a93cfd0.jpg</td>\n",
       "      <td>Beige Top</td>\n",
       "      <td>M</td>\n",
       "      <td>F</td>\n",
       "      <td>This beige top has a boat neck, a pocket in fr...</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.020475557, 0.032990508, 0.0145089375, -0.0...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                   Filename  \\\n",
       "0  d7ed1d64-2c65-427f-9ae4-eb4aaa3e2389.jpg   \n",
       "1  5c1b7a77-1fa3-4af8-9722-cd38e45d89da.jpg   \n",
       "2  b2e084c7-e3a0-4182-8671-b908544a7cf2.jpg   \n",
       "3  87846aa9-86cc-404a-af2c-7e8fe941081d.jpg   \n",
       "4  04fa06fb-d71a-4293-9804-fe799375a682.jpg   \n",
       "5  8f576f1a-839d-4fb2-a224-a4700b2d05da.jpg   \n",
       "6  e976a8f6-6731-485f-8a9a-2872a5208818.jpg   \n",
       "7  bbf0d9c7-663d-46d1-a9f8-66e8e5678541.jpg   \n",
       "8  e25a7faa-7a49-4e72-a7ef-e74427f77784.jpg   \n",
       "9  d995ac1f-fbd0-482c-a308-dafb6a93cfd0.jpg   \n",
       "\n",
       "                                               Title Size  Gender  \\\n",
       "0  Stylish and Trendy Tank Top with Celestial Design    M       F   \n",
       "1                           Classic White Sweatshirt    M       F   \n",
       "2                                       Grey T-shirt    M  Unisex   \n",
       "3                          Long-Sleeved V-Neck Shirt    L       U   \n",
       "4                     Silver Metallic Buckle Sandals    L       F   \n",
       "5                         Orange Long Sleeve T-Shirt    S       U   \n",
       "6                                      Green T-Shirt    L       M   \n",
       "7                     White Quarter Zip Pullover Top    L       U   \n",
       "8                         Aviator Sunglasses T-Shirt    M       F   \n",
       "9                                          Beige Top    M       F   \n",
       "\n",
       "                                         Description Category    Type  \\\n",
       "0  This white tank top is a stylish and trendy pi...     Tops  Casual   \n",
       "1  This classic white sweatshirt is a timeless pi...     Tops  Casual   \n",
       "2  This is a short-sleeved, crew neck t-shirt tha...  T-Shirt  Casual   \n",
       "3  A long-sleeved, V-neck shirt with a solid purp...     Tops  Casual   \n",
       "4  These silver metallic buckle sandals feature a...    Shoes  Casual   \n",
       "5  This long sleeve t-shirt is made of a lightwei...     Tops  Casual   \n",
       "6  The green t-shirt is a relaxed fit with a V-ne...     Tops  Casual   \n",
       "7  This pullover top has a quarter zip closure at...     Tops  Casual   \n",
       "8  This sleeveless red T-shirt features a large b...     Tops  Casual   \n",
       "9  This beige top has a boat neck, a pocket in fr...     Tops  Casual   \n",
       "\n",
       "                                              vector  \n",
       "0  [-0.06355423, 0.02385288, 0.03382446, -0.00212...  \n",
       "1  [-0.011691423, 0.049270794, 0.030319242, -0.02...  \n",
       "2  [-0.010150914, 0.09637642, -0.0012558334, 0.04...  \n",
       "3  [-0.058710814, 0.053951632, -0.047531255, 0.03...  \n",
       "4  [0.0123484805, 0.02398385, 0.059779372, -0.006...  \n",
       "5  [-0.016778396, 0.06664105, -0.010597771, 0.052...  \n",
       "6  [0.015946185, 0.07543863, 0.032447945, 0.00442...  \n",
       "7  [-0.05592024, 0.03401515, -0.0057456787, 0.030...  \n",
       "8  [-0.040058654, 0.090077035, -0.020889325, 0.03...  \n",
       "9  [-0.020475557, 0.032990508, 0.0145089375, -0.0...  "
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tbl.search().to_pandas()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "94652723-7813-48db-8089-cbee2ee8fc85",
   "metadata": {},
   "source": [
    "#### Approach 1/3: Using Text Search\n",
    "\n",
    "The approach we will take first is:\n",
    "\n",
    "- Upload an image and ask `3.2-11B-Instruct` from Together to describe the image\n",
    "- We will then try to find similar images in the dataset\n",
    "\n",
    "Note: This is to validate that our pipeline is working, in the final demo-we prompt Llama to find complementary clothes."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "84a9a7a0-8849-4cdc-b802-ab28b7438099",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Jeans are a classic pairing option. Dark wash skinny jeans create a sleek look, while light wash boyfriend jeans add a casual touch. Black trousers offer a dressier alternative. Khaki chinos provide a neutral background for the plaid pattern. Corduroy pants add a rustic feel. Wool trousers bring a sophisticated element. Leather pants create a bold statement.\n"
     ]
    }
   ],
   "source": [
    "prompt = prompt + \"Please answer within 100 words consisely and only provide the answer, don't\" \\\n",
    "            \"repeat any word from the input, start your response from the clothing items that can be paired with the input\"\n",
    "response = client.chat.completions.create(\n",
    "    model=\"meta-llama/Llama-Vision-Free\",\n",
    "    messages=[\n",
    "                {\n",
    "                \"role\": \"user\",\n",
    "                \"content\": [\n",
    "                        {\n",
    "                                \"type\": \"text\",\n",
    "                                \"text\": prompt\n",
    "                        }\n",
    "                ]\n",
    "        },\n",
    "    ],\n",
    "    max_tokens=512,\n",
    "    temperature=0.7,\n",
    "    top_p=0.7,\n",
    "    top_k=50,\n",
    "    repetition_penalty=1,\n",
    "    stop=[\"<|eot_id|>\",\"<|eom_id|>\"],\n",
    ")\n",
    "print(response.choices[0].message.content)\n",
    "response = response.choices[0].message.content"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "5f0b36e0-761b-4e6f-a3df-e12c36caca0a",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Filename</th>\n",
       "      <th>Title</th>\n",
       "      <th>Size</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Description</th>\n",
       "      <th>Category</th>\n",
       "      <th>Type</th>\n",
       "      <th>vector</th>\n",
       "      <th>_distance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>7a6e7ddb-ac03-4d78-9d71-75320e5913da.jpg</td>\n",
       "      <td>Light-Washed Jeans</td>\n",
       "      <td>S</td>\n",
       "      <td>F</td>\n",
       "      <td>These light-washed jeans are a pair of stylish...</td>\n",
       "      <td>Jeans</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.063473865, 0.060125574, 0.02189098, -0.002...</td>\n",
       "      <td>0.407864</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>7a6e7ddb-ac03-4d78-9d71-75320e5913da.jpg</td>\n",
       "      <td>Light-Washed Jeans</td>\n",
       "      <td>S</td>\n",
       "      <td>F</td>\n",
       "      <td>These light-washed jeans are a pair of stylish...</td>\n",
       "      <td>Jeans</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.063473865, 0.060125574, 0.02189098, -0.002...</td>\n",
       "      <td>0.407864</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8db4d594-4688-4447-a5b9-cd5c68b1870e.jpg</td>\n",
       "      <td>Black Pant</td>\n",
       "      <td>S</td>\n",
       "      <td>U</td>\n",
       "      <td>This pair of black pants appears to be made of...</td>\n",
       "      <td>Pants</td>\n",
       "      <td>Casual</td>\n",
       "      <td>[-0.014388849, 0.082536675, 0.011225891, -0.00...</td>\n",
       "      <td>0.412849</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                   Filename               Title Size Gender  \\\n",
       "0  7a6e7ddb-ac03-4d78-9d71-75320e5913da.jpg  Light-Washed Jeans    S      F   \n",
       "1  7a6e7ddb-ac03-4d78-9d71-75320e5913da.jpg  Light-Washed Jeans    S      F   \n",
       "2  8db4d594-4688-4447-a5b9-cd5c68b1870e.jpg          Black Pant    S      U   \n",
       "\n",
       "                                         Description Category    Type  \\\n",
       "0  These light-washed jeans are a pair of stylish...    Jeans  Casual   \n",
       "1  These light-washed jeans are a pair of stylish...    Jeans  Casual   \n",
       "2  This pair of black pants appears to be made of...    Pants  Casual   \n",
       "\n",
       "                                              vector  _distance  \n",
       "0  [-0.063473865, 0.060125574, 0.02189098, -0.002...   0.407864  \n",
       "1  [-0.063473865, 0.060125574, 0.02189098, -0.002...   0.407864  \n",
       "2  [-0.014388849, 0.082536675, 0.011225891, -0.00...   0.412849  "
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# automatically converted to vector representation\n",
    "rs = tbl.search(response).limit(3).to_pandas()\n",
    "rs\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "e74a805a-28a9-4442-9477-65808321cb3c",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "imgs = show_image_from_response(rs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "ffa32a2e-de10-4a68-b480-9639394564cc",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/jpeg": "[encoded data, 30772 characters]",
      "image/png": "[encoded data, 273884 characters]",
      "text/plain": [
       "<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=400x534>"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "imgs[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "943d2358-d378-4446-860b-cda9f9154752",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/jpeg": "[encoded data, 30772 characters]",
      "image/png": "[encoded data, 273884 characters]",
      "text/plain": [
       "<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=400x534>"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "imgs[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "56efb82d-8e63-4ad1-97c2-29135ae361e2",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/jpeg": "[encoded data, 23472 characters]",
      "image/png": "[encoded data, 224832 characters]",
      "text/plain": [
       "<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=400x533>"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "imgs[2]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "908e8c15-9e42-4457-b60d-b0b1fdca7b23",
   "metadata": {},
   "source": [
    "#### Approach 2/3: Using Full Text-Search"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "id": "141a5e42-32fc-4e8d-9efb-e0c1e00305ba",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "tbl.create_fts_index(\"Description\", replace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "id": "c08a8699-24b2-4843-9437-842cb0d09c5b",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>filename</th>\n",
       "      <th>Description</th>\n",
       "      <th>vector</th>\n",
       "      <th>Title</th>\n",
       "      <th>Size</th>\n",
       "      <th>Category</th>\n",
       "      <th>Type</th>\n",
       "      <th>Gender</th>\n",
       "      <th>_score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0e20abb0-d56a-4f83-b254-9db70fb92794.jpg</td>\n",
       "      <td>This shirt is a long-sleeved, black and grey s...</td>\n",
       "      <td>[-0.045025624, 0.041662034, -0.0006505165, 0.0...</td>\n",
       "      <td>Black and Grey Striped Shirt with Pink Accents</td>\n",
       "      <td>S</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>F</td>\n",
       "      <td>52.089787</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10e51a41-3729-472e-b288-f3b8f895577a.jpg</td>\n",
       "      <td>This plaid shirt features a classic plaid patt...</td>\n",
       "      <td>[-0.044541422, 0.05006024, -0.04257077, 0.0401...</td>\n",
       "      <td>Plaid shirt with embroidered hem</td>\n",
       "      <td>L</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>F</td>\n",
       "      <td>35.616638</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>bd289469-607c-45df-bad3-ed1057e277bf.jpg</td>\n",
       "      <td>This is a red and black plaid skirt with a cla...</td>\n",
       "      <td>[-0.021971317, 0.12156065, -0.002515854, 0.034...</td>\n",
       "      <td>Red and Black Plaid Skirt</td>\n",
       "      <td>S</td>\n",
       "      <td>Skirts</td>\n",
       "      <td>Casual</td>\n",
       "      <td>F</td>\n",
       "      <td>34.096905</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>64c5d20e-7cec-4965-8c50-315389f44b22.jpg</td>\n",
       "      <td>These light washed blue jeans are distressed w...</td>\n",
       "      <td>[-0.07545003, 0.05375045, 0.00353413, -0.01551...</td>\n",
       "      <td>Light Washed Blue Ripped Jeans</td>\n",
       "      <td>L</td>\n",
       "      <td>Jeans</td>\n",
       "      <td>Casual</td>\n",
       "      <td>M</td>\n",
       "      <td>29.116760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>b0c03127-9dfb-4573-8934-1958396937bf.jpg</td>\n",
       "      <td>This red flannel plaid shirt has a classic and...</td>\n",
       "      <td>[-0.03013145, 0.060508166, -0.03642542, 0.0301...</td>\n",
       "      <td>Red Flannel Plaid Shirt</td>\n",
       "      <td>S</td>\n",
       "      <td>Shirts</td>\n",
       "      <td>Casual</td>\n",
       "      <td>M</td>\n",
       "      <td>28.444168</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                   filename  \\\n",
       "0  0e20abb0-d56a-4f83-b254-9db70fb92794.jpg   \n",
       "1  10e51a41-3729-472e-b288-f3b8f895577a.jpg   \n",
       "2  bd289469-607c-45df-bad3-ed1057e277bf.jpg   \n",
       "3  64c5d20e-7cec-4965-8c50-315389f44b22.jpg   \n",
       "4  b0c03127-9dfb-4573-8934-1958396937bf.jpg   \n",
       "\n",
       "                                         Description  \\\n",
       "0  This shirt is a long-sleeved, black and grey s...   \n",
       "1  This plaid shirt features a classic plaid patt...   \n",
       "2  This is a red and black plaid skirt with a cla...   \n",
       "3  These light washed blue jeans are distressed w...   \n",
       "4  This red flannel plaid shirt has a classic and...   \n",
       "\n",
       "                                              vector  \\\n",
       "0  [-0.045025624, 0.041662034, -0.0006505165, 0.0...   \n",
       "1  [-0.044541422, 0.05006024, -0.04257077, 0.0401...   \n",
       "2  [-0.021971317, 0.12156065, -0.002515854, 0.034...   \n",
       "3  [-0.07545003, 0.05375045, 0.00353413, -0.01551...   \n",
       "4  [-0.03013145, 0.060508166, -0.03642542, 0.0301...   \n",
       "\n",
       "                                            Title Size Category    Type  \\\n",
       "0  Black and Grey Striped Shirt with Pink Accents    S     Tops  Casual   \n",
       "1                Plaid shirt with embroidered hem    L     Tops  Casual   \n",
       "2                       Red and Black Plaid Skirt    S   Skirts  Casual   \n",
       "3                  Light Washed Blue Ripped Jeans    L    Jeans  Casual   \n",
       "4                         Red Flannel Plaid Shirt    S   Shirts  Casual   \n",
       "\n",
       "  Gender     _score  \n",
       "0      F  52.089787  \n",
       "1      F  35.616638  \n",
       "2      F  34.096905  \n",
       "3      M  29.116760  \n",
       "4      M  28.444168  "
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rs = tbl.search(response, query_type=\"fts\").limit(5).to_pandas()\n",
    "rs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "id": "a8b196b4-f526-41f5-95ad-08781b1d2f0d",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "imgs = show_image_from_response(rs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "id": "e631f244-3e99-43e3-878b-15ac639e5bb9",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/jpeg": "[encoded data, 55448 characters]",
      "image/png": "[encoded data, 510812 characters]",
      "text/plain": [
       "<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=400x533>"
      ]
     },
     "execution_count": 145,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "imgs[-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 146,
   "id": "e011f438-8899-4605-ba05-55df0ce95d01",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/jpeg": "[encoded data, 35840 characters]",
      "image/png": "[encoded data, 314496 characters]",
      "text/plain": [
       "<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=400x534>"
      ]
     },
     "execution_count": 146,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "imgs[-2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 148,
   "id": "1d6cbbd3-9fbb-4cfe-978d-4ece85a65f33",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/jpeg": "[encoded data, 59548 characters]",
      "image/png": "[encoded data, 456644 characters]",
      "text/plain": [
       "<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=533x400>"
      ]
     },
     "execution_count": 148,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "imgs[-3]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6370d9aa-3262-4234-915a-0459db9144ad",
   "metadata": {},
   "source": [
    "#### Approach 3/3: Using Hybrid search"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 153,
   "id": "46bcbeba-0f7b-4a84-a064-220ab61f1bbf",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loading ColBERTRanker model colbert-ir/colbertv2.0\n",
      "No device set\n",
      "Using device cuda\n",
      "No dtype set\n",
      "Using dtype torch.float16\n",
      "Loading model colbert-ir/colbertv2.0, this might take a while...\n",
      "Linear Dim set to: {linear_dim} for downcasting\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>filename</th>\n",
       "      <th>Description</th>\n",
       "      <th>vector</th>\n",
       "      <th>Title</th>\n",
       "      <th>Size</th>\n",
       "      <th>Category</th>\n",
       "      <th>Type</th>\n",
       "      <th>Gender</th>\n",
       "      <th>_relevance_score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0e20abb0-d56a-4f83-b254-9db70fb92794.jpg</td>\n",
       "      <td>This shirt is a long-sleeved, black and grey s...</td>\n",
       "      <td>[-0.045025624, 0.041662034, -0.0006505165, 0.0...</td>\n",
       "      <td>Black and Grey Striped Shirt with Pink Accents</td>\n",
       "      <td>S</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>F</td>\n",
       "      <td>0.744141</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10e51a41-3729-472e-b288-f3b8f895577a.jpg</td>\n",
       "      <td>This plaid shirt features a classic plaid patt...</td>\n",
       "      <td>[-0.044541422, 0.05006024, -0.04257077, 0.0401...</td>\n",
       "      <td>Plaid shirt with embroidered hem</td>\n",
       "      <td>L</td>\n",
       "      <td>Tops</td>\n",
       "      <td>Casual</td>\n",
       "      <td>F</td>\n",
       "      <td>0.735352</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>300a4125-acec-46aa-b0b9-68b4b2142c70.jpg</td>\n",
       "      <td>These plaid shorts are a stylish and comfortab...</td>\n",
       "      <td>[-0.002765015, 0.030705247, -0.010424565, -0.0...</td>\n",
       "      <td>Plaid Shorts</td>\n",
       "      <td>S</td>\n",
       "      <td>Pants</td>\n",
       "      <td>Casual</td>\n",
       "      <td>M</td>\n",
       "      <td>0.728516</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>bd289469-607c-45df-bad3-ed1057e277bf.jpg</td>\n",
       "      <td>This is a red and black plaid skirt with a cla...</td>\n",
       "      <td>[-0.021971317, 0.12156065, -0.002515854, 0.034...</td>\n",
       "      <td>Red and Black Plaid Skirt</td>\n",
       "      <td>S</td>\n",
       "      <td>Skirts</td>\n",
       "      <td>Casual</td>\n",
       "      <td>F</td>\n",
       "      <td>0.699219</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>b0c03127-9dfb-4573-8934-1958396937bf.jpg</td>\n",
       "      <td>This red flannel plaid shirt has a classic and...</td>\n",
       "      <td>[-0.03013145, 0.060508166, -0.03642542, 0.0301...</td>\n",
       "      <td>Red Flannel Plaid Shirt</td>\n",
       "      <td>S</td>\n",
       "      <td>Shirts</td>\n",
       "      <td>Casual</td>\n",
       "      <td>M</td>\n",
       "      <td>0.679199</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                   filename  \\\n",
       "0  0e20abb0-d56a-4f83-b254-9db70fb92794.jpg   \n",
       "1  10e51a41-3729-472e-b288-f3b8f895577a.jpg   \n",
       "2  300a4125-acec-46aa-b0b9-68b4b2142c70.jpg   \n",
       "3  bd289469-607c-45df-bad3-ed1057e277bf.jpg   \n",
       "4  b0c03127-9dfb-4573-8934-1958396937bf.jpg   \n",
       "\n",
       "                                         Description  \\\n",
       "0  This shirt is a long-sleeved, black and grey s...   \n",
       "1  This plaid shirt features a classic plaid patt...   \n",
       "2  These plaid shorts are a stylish and comfortab...   \n",
       "3  This is a red and black plaid skirt with a cla...   \n",
       "4  This red flannel plaid shirt has a classic and...   \n",
       "\n",
       "                                              vector  \\\n",
       "0  [-0.045025624, 0.041662034, -0.0006505165, 0.0...   \n",
       "1  [-0.044541422, 0.05006024, -0.04257077, 0.0401...   \n",
       "2  [-0.002765015, 0.030705247, -0.010424565, -0.0...   \n",
       "3  [-0.021971317, 0.12156065, -0.002515854, 0.034...   \n",
       "4  [-0.03013145, 0.060508166, -0.03642542, 0.0301...   \n",
       "\n",
       "                                            Title Size Category    Type  \\\n",
       "0  Black and Grey Striped Shirt with Pink Accents    S     Tops  Casual   \n",
       "1                Plaid shirt with embroidered hem    L     Tops  Casual   \n",
       "2                                    Plaid Shorts    S    Pants  Casual   \n",
       "3                       Red and Black Plaid Skirt    S   Skirts  Casual   \n",
       "4                         Red Flannel Plaid Shirt    S   Shirts  Casual   \n",
       "\n",
       "  Gender  _relevance_score  \n",
       "0      F          0.744141  \n",
       "1      F          0.735352  \n",
       "2      M          0.728516  \n",
       "3      F          0.699219  \n",
       "4      M          0.679199  "
      ]
     },
     "execution_count": 153,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from lancedb.rerankers import ColbertReranker\n",
    "\n",
    "reranker = ColbertReranker(column=\"Description\")\n",
    "rs = tbl.search(response, query_type=\"hybrid\").rerank(reranker=reranker).limit(5).to_pandas()\n",
    "rs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 154,
   "id": "965061ed-59ad-4ab3-a15d-fd7766321cf8",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "imgs = show_image_from_response(rs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "id": "1e397943-5a60-4067-96e1-2d4981193e8c",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/jpeg": "[encoded data, 55448 characters]",
      "image/png": "[encoded data, 510812 characters]",
      "text/plain": [
       "<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=400x533>"
      ]
     },
     "execution_count": 155,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "imgs[-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "id": "06c35240-f9d8-4518-84e6-cd46bb567330",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/jpeg": "[encoded data, 59548 characters]",
      "image/png": "[encoded data, 456644 characters]",
      "text/plain": [
       "<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=533x400>"
      ]
     },
     "execution_count": 156,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "imgs[-2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f9b82b17-3270-4b37-80d0-e989e13c4fea",
   "metadata": {},
   "outputs": [],
   "source": [
    "#fin"
   ]
  }
 ],
 "metadata": {
  "environment": {
   "kernel": "conda-base-py",
   "name": "workbench-notebooks.m125",
   "type": "gcloud",
   "uri": "us-docker.pkg.dev/deeplearning-platform-release/gcr.io/workbench-notebooks:m125"
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
