{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "42c51c28-61dd-4b1d-885e-246cde91c68f",
      "metadata": {
        "id": "42c51c28-61dd-4b1d-885e-246cde91c68f"
      },
      "outputs": [],
      "source": []
    },
    {
      "cell_type": "markdown",
      "id": "ac2d1ace-9fc6-4c3d-a06a-92747b7f7478",
      "metadata": {
        "id": "ac2d1ace-9fc6-4c3d-a06a-92747b7f7478"
      },
      "source": [
        "### Are you using Google colab instead of your environment ? then uncomment the following lines and put your login token before submit()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "id": "42479ac0-1018-4e37-a123-b8f0325d8b1e",
      "metadata": {
        "ExecuteTime": {
          "end_time": "2024-07-10T16:27:51.604722Z",
          "start_time": "2024-07-10T16:27:51.601703Z"
        },
        "tags": [],
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 145,
          "referenced_widgets": [
            "bc86d70ffa424be39f0aff0bee05ebaa",
            "7abee69fe25f427a9400596740c89447",
            "c4c070b4ac3b491893c47a0d04cef794",
            "d42003f8fee1415baa7779a835df23ff",
            "f84d7883d61e4b59a2cdae7655bf5279",
            "845fffec68bb4f2fa61b7cb02dc6e985",
            "af69c16ea39448ee83d894e51febd27a",
            "30a7225d536b4284b6f45e9ba4b989c2",
            "a79ffbb9258d450e9d5810f0d9fd1468",
            "8cd9a72aa40744229dc3954abe7518d4",
            "8ea10cadb7f643458c1c5115b8db7160",
            "2276a00f5cc84122a36135ab8a61d05e",
            "b0c75df0c98b4bff91107196ed020e7d",
            "8a73a43d448a4d78a8bdafecdb60dbb5",
            "9133132c84434ce7818219dc08be7637",
            "b942c50600884f178718627d672db8ce",
            "e510cce8dd8f4618af520827e0659ba8",
            "c31fde39c8f64e7f930913b942e9ea64",
            "955173ff70974180a3557ec8d4ab8aeb",
            "3ed58b6380b0415a8866358e863b1e43",
            "16026f5520b94e8d9b721874df4e1a21",
            "2b2e3cddd9bc4e60ad31c708564e5690",
            "08ab84d504c14d7bbf5fa512b784f03f",
            "4808c81b7ad24dec8b1820479b2b039b",
            "b0e9bb5b619b44cc896afc72c2bbb6c6",
            "ae8a88118f9a43099ab1bd9855ba1e74",
            "d62c3b1aac5a493ea1e97291b3d96606",
            "c9f81c60939049cf96399fefabe95a9a",
            "14c7fae5e3634da29526d2c695252e6c",
            "30dfe81c74504ec1ae2e0e55d6b39327",
            "17e0e58446cc4d01a0cc666dd77b141a",
            "dd6cf72bc28d480ea77999f2ce6f2a52"
          ]
        },
        "id": "42479ac0-1018-4e37-a123-b8f0325d8b1e",
        "outputId": "15ef3c2b-cc9c-4fc9-bfc8-4edef7edd083"
      },
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "VBox(children=(HTML(value='<center> <img\\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.sv…"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "bc86d70ffa424be39f0aff0bee05ebaa"
            }
          },
          "metadata": {}
        }
      ],
      "source": [
        "# from huggingface_hub import notebook_login\n",
        "# notebook_login()"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "38ca690b-9b31-44c3-8cfb-e5cde28df42d",
      "metadata": {
        "tags": [],
        "id": "38ca690b-9b31-44c3-8cfb-e5cde28df42d"
      },
      "source": [
        "# Order:\n",
        "    - 1. Check the IOAI2024_CV_Problem_Intro.ipynb notebook for some theory\n",
        "    - 2. Solve the task from this notebook\n",
        "    - . [OPTIONAL] Finally evaluate your solution in the IOAI2024_CV_Problem_EVAL.ipynb notebook"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "cc170f9f-d3bb-455f-979f-0e13ff08232b",
      "metadata": {
        "id": "cc170f9f-d3bb-455f-979f-0e13ff08232b"
      },
      "source": [
        "# Installing the required packages"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "6464faf7-ce0c-41c2-8b40-39eabd12338b",
      "metadata": {
        "jupyter": {
          "outputs_hidden": false
        },
        "tags": [],
        "id": "6464faf7-ce0c-41c2-8b40-39eabd12338b"
      },
      "outputs": [],
      "source": [
        "import importlib\n",
        "if importlib.util.find_spec('diffusers') is None:\n",
        "    !pip install diffusers transformers accelerate datasets\n",
        "\n",
        "\n",
        "if importlib.util.find_spec('huggingface_hub') is None:\n",
        "    !pip install huggingface_hub\n",
        "\n",
        "!pip install datasets"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "394e2f82-3171-4c4c-8dca-8938a7b15939",
      "metadata": {
        "id": "394e2f82-3171-4c4c-8dca-8938a7b15939"
      },
      "source": [
        "# Downloading the dataset and base model"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "a4c751e9-e762-4d44-8f96-c66a805ffe62",
      "metadata": {
        "jupyter": {
          "outputs_hidden": false
        },
        "tags": [],
        "id": "a4c751e9-e762-4d44-8f96-c66a805ffe62"
      },
      "outputs": [],
      "source": [
        "from torch.utils.data import DataLoader\n",
        "import math\n",
        "import numpy as np\n",
        "import torch\n",
        "import torch.nn.functional as F\n",
        "import torch.utils.checkpoint\n",
        "from datasets import load_dataset\n",
        "from torchvision import transforms\n",
        "from tqdm import tqdm\n",
        "from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler\n",
        "import torch\n",
        "\n",
        "#Load a dataset\n",
        "dataset = load_dataset('unibuc-cs/ROAItransportationCo', split='train')#, trust_remote_code=True)\n",
        "\n",
        "base_model_name =  \"unibuc-cs/ROAITransportationCo_v2\"\n",
        "weight_dtype = torch.bfloat16\n",
        "pipe = DiffusionPipeline.from_pretrained(base_model_name, torch_dtype=weight_dtype)\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "904015710ceb49f9",
      "metadata": {
        "ExecuteTime": {
          "end_time": "2024-07-10T16:36:19.653870Z",
          "start_time": "2024-07-10T16:36:17.959156Z"
        },
        "id": "904015710ceb49f9"
      },
      "outputs": [],
      "source": [
        "from torch.utils.data import DataLoader\n",
        "import math\n",
        "import numpy as np\n",
        "import torch\n",
        "import torch.nn.functional as F\n",
        "import torch.utils.checkpoint\n",
        "from datasets import load_dataset\n",
        "from torchvision import transforms\n",
        "from tqdm import tqdm\n",
        "from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler\n",
        "import torch\n",
        "\n",
        "weight_dtype = torch.bfloat16\n",
        "device = \"cuda\"\n",
        "\n",
        "# Load the base mini stable diffusion model\n",
        "base_model_name =  \"unibuc-cs/ROAITransportationCo_v2\"\n",
        "pipe = DiffusionPipeline.from_pretrained(base_model_name,\n",
        "                                         torch_dtype=weight_dtype,\n",
        "                                         safety_checker = None,\n",
        "                                        requires_safety_checker = False)\n",
        "pipe = pipe.to(device)\n",
        "\n",
        "# Setup some learning parameters\n",
        "# TODO 1 (very low priority): You can play with these.\n",
        "# If you do not have GPU memory, you can try to reduce the train_batch_size\n",
        "# Important:  Try to set a limited train_steps in the begging until you are convinced by some setup that work and lowers the error\n",
        "# (this is valid for other TODOs as well)\n",
        "learning_rate = 2e-05\n",
        "resolution = 256 # might get interesting too.\n",
        "max_train_steps = 101\n",
        "train_batch_size = 8\n",
        "\n",
        "# Extract the individual components and put them on the device and specific weights\n",
        "# Just informative, let the code below as it is\n",
        "#-----\n",
        "vae = pipe.vae\n",
        "text_encoder = pipe.text_encoder\n",
        "tokenizer = pipe.tokenizer\n",
        "unet = pipe.unet\n",
        "noise_scheduler = pipe.scheduler\n",
        "\n",
        "# Move text_encode and vae to gpu and cast to weight_dtype\n",
        "text_encoder = text_encoder.to(device, dtype=weight_dtype)\n",
        "vae = vae.to(device, dtype=weight_dtype)\n",
        "unet = unet.to(device, dtype=weight_dtype)\n",
        "#-----"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "30b02663-0a74-4299-83a4-ba7102059b92",
      "metadata": {
        "id": "30b02663-0a74-4299-83a4-ba7102059b92"
      },
      "source": [
        "## Dataset loading and preparation\n",
        "The function below is a standalone function that returns a dataloader for training the components.\n",
        "\n",
        "You might need first to filter the records of the dataset first.\n",
        "\n",
        "It is not required, but you might want to play with the resolution parameter (defined in a cell above), or add additional augmentation in train_transformers sequence, in between the resize and ToTensor. You can take a look here: https://pytorch.org/vision/stable/transforms.html  "
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "id": "5f9ea76d-0da8-48ae-811c-d0e092a4e4a3",
      "metadata": {
        "ExecuteTime": {
          "end_time": "2024-07-10T16:36:32.557379Z",
          "start_time": "2024-07-10T16:36:26.506218Z"
        },
        "id": "5f9ea76d-0da8-48ae-811c-d0e092a4e4a3"
      },
      "outputs": [],
      "source": [
        "def prepare_dataset_loader():\n",
        "    # convert dataset to a loader that could be feed during training\n",
        "    def tokenize_captions(examples, is_train=True):\n",
        "        captions = examples['text']\n",
        "        inputs = tokenizer(\n",
        "            captions, max_length=tokenizer.model_max_length, padding=\"max_length\", truncation=True, return_tensors=\"pt\"\n",
        "        )\n",
        "        return inputs.input_ids\n",
        "\n",
        "    def preprocess_train(examples):\n",
        "        images = [image.convert(\"RGB\") for image in examples['image']]\n",
        "        examples[\"pixel_values\"] = [train_transforms(image) for image in images]\n",
        "        examples[\"input_ids\"] = tokenize_captions(examples)\n",
        "        return examples\n",
        "\n",
        "    def collate_fn(examples):\n",
        "        pixel_values = torch.stack([example[\"pixel_values\"] for example in examples])\n",
        "        pixel_values = pixel_values.to(memory_format=torch.contiguous_format).float()\n",
        "        input_ids = torch.stack([example[\"input_ids\"] for example in examples])\n",
        "        return {\"pixel_values\": pixel_values, \"input_ids\": input_ids}\n",
        "\n",
        "    # Preprocessing the datasets.\n",
        "    train_transforms = transforms.Compose(\n",
        "        [\n",
        "            transforms.Resize(resolution, interpolation=transforms.InterpolationMode.BILINEAR),\n",
        "\n",
        "            # ----\n",
        "            # TODO 3.5 (very low priority): You might add additional augmentation\n",
        "            transforms.CenterCrop(resolution),\n",
        "            transforms.RandomHorizontalFlip(),\n",
        "\n",
        "            #----\n",
        "            transforms.ToTensor(),\n",
        "            transforms.Normalize([0.5], [0.5]),\n",
        "        ]\n",
        "    )\n",
        "\n",
        "    # Load a dataset\n",
        "    dataset = load_dataset('unibuc-cs/ROAItransportationCo', split='train', trust_remote_code=True)\n",
        "\n",
        "    train_dataset = dataset.with_transform(preprocess_train)\n",
        "\n",
        "    # TODO 3: filter the dataset to consider only the case interesting classes, i.e.,\n",
        "    # if the label (which is a text) for each image contains one of the mentioned classes\n",
        "    # Hint: you might also balance a bit to select more items from the new labels added (vehicles) rather than the previous ones,\n",
        "    # but at the same time keep some of the previous in. If you need more info how to process and filter data the dataset, check here:\n",
        "    # https://huggingface.co/docs/datasets/v2.20.0/process#select-and-filter , for API. I remember that the previous engineer was just\n",
        "    # checking if words: bus truck and train,  are in the images labels.\n",
        "\n",
        "\n",
        "    # Data Loader final object used during training process\n",
        "    train_dataloader = torch.utils.data.DataLoader(\n",
        "        train_dataset,\n",
        "        shuffle=True,\n",
        "        collate_fn=collate_fn,\n",
        "        batch_size=train_batch_size,\n",
        "        num_workers=0,\n",
        "    )\n",
        "\n",
        "    return train_dataloader\n",
        "\n",
        "train_dataloader = prepare_dataset_loader()\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "95a561f7-d089-42bb-9b20-a7d980d5342e",
      "metadata": {
        "id": "95a561f7-d089-42bb-9b20-a7d980d5342e"
      },
      "source": [
        "### Let's sample some things from dataset to ensure that we don't messup with the transformations or any other parameters!\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "63c58f46-b672-4797-a75b-537e8258413f",
      "metadata": {
        "ExecuteTime": {
          "end_time": "2024-07-10T16:36:32.674486Z",
          "start_time": "2024-07-10T16:36:32.557379Z"
        },
        "id": "63c58f46-b672-4797-a75b-537e8258413f"
      },
      "outputs": [],
      "source": [
        "# We just copy-pase some of the code froim the INTRO notebook\n",
        "\n",
        "###################\n",
        "from PIL import Image\n",
        "\n",
        "# Create a generator and set a seed to id for reproducibily\n",
        "generator = torch.Generator(\"cuda\").manual_seed(0)\n",
        "\n",
        "def image_grid(imgs, rows=2, cols=2):\n",
        "    w, h = imgs[0].size\n",
        "    grid = Image.new(\"RGB\", size=(cols * w, rows * h))\n",
        "\n",
        "    for i, img in enumerate(imgs):\n",
        "        grid.paste(img, box=(i % cols * w, i // cols * h))\n",
        "    return grid\n",
        "\n",
        "def generate_img(prompt):\n",
        "    image = pipe(prompt=prompt, generator=torch.Generator(device=device).manual_seed(42), num_inference_steps=50).images[0]\n",
        "    image.resize((384, 384))\n",
        "    return image\n",
        "\n",
        "\n",
        "\n",
        "### Now let's sample a batch of data so see how it works\n",
        "sample_batch = next(iter(train_dataloader))\n",
        "sample_pixels = (sample_batch['pixel_values'] * 0.5) + 0.5 # These is the conversion back to original data range\n",
        "sample_input_ids = sample_batch['input_ids']\n",
        "\n",
        "sample_texts_decoded = []\n",
        "for item in sample_input_ids:\n",
        "    item_text = \"\"\n",
        "    for token in item:\n",
        "        if token !=49406 and token !=49407: # those start/end/padding tokens\n",
        "            item_text += tokenizer.decode(token) + \" \"\n",
        "\n",
        "    sample_texts_decoded.append(item_text)\n",
        "\n",
        "\n",
        "transf_to_img = transforms.ToPILImage()\n",
        "sample_images = [transf_to_img(x) for x in sample_pixels]\n",
        "display(image_grid(sample_images, 1, train_batch_size))\n",
        "\n",
        "for textt in sample_texts_decoded:\n",
        "    print(textt)"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "94bd3e72-b589-4563-a759-19b5b3a5ca6f",
      "metadata": {
        "id": "94bd3e72-b589-4563-a759-19b5b3a5ca6f"
      },
      "source": [
        "## Chose what you train from the diffusion pipeline\n",
        "\n",
        "- remember that the tokenizer is frozen, is good enough\n",
        "- you can unfreeze one of vae, unet, or both components at the same time!\n",
        "- remember that each of them has a different number of parameters and can affect the training results in various ways. However, our previous engineer was training only the UNET!"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "id": "899bf670-59ff-4c9c-a3af-e5378aa68f69",
      "metadata": {
        "id": "899bf670-59ff-4c9c-a3af-e5378aa68f69"
      },
      "outputs": [],
      "source": [
        "# By default we do not train any component, but if we don't train anything we don't get improvements.\n",
        "# However, our previous engineer was training only the UNET!\n",
        "# TODO 2: You can set any of them on True, or even both!\n",
        "train_UNET = False\n",
        "train_VAE = False\n",
        "\n",
        "\n",
        "# Please let it freeze :)\n",
        "text_encoder.requires_grad_(False)\n",
        "\n",
        "# Decide\n",
        "if train_VAE is True:\n",
        "    vae.train()\n",
        "else:\n",
        "    vae.requires_grad_(False)\n",
        "\n",
        "if train_UNET is True:\n",
        "    unet.train()\n",
        "else:\n",
        "    unet.requires_grad_(False)\n",
        "\n",
        "# Only If you train VAE too, add both set of parameters here. Otherwise optimizer won't do anything on them\n",
        "optimizer = torch.optim.AdamW(unet.parameters(), lr=learning_rate)"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "cc37017d-fdbd-4362-90b2-6c28c077e6ce",
      "metadata": {
        "id": "cc37017d-fdbd-4362-90b2-6c28c077e6ce"
      },
      "source": [
        "## The training loop - your main playtoy!"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "a4b36bf2-4211-4152-9b63-c9fe4d749388",
      "metadata": {
        "ExecuteTime": {
          "end_time": "2024-07-10T16:36:42.358691Z",
          "start_time": "2024-07-10T16:36:32.684298Z"
        },
        "id": "a4b36bf2-4211-4152-9b63-c9fe4d749388"
      },
      "outputs": [],
      "source": [
        "num_train_epochs = math.ceil(max_train_steps * train_batch_size / len(train_dataloader))\n",
        "print(\"***** Running training *****\")\n",
        "print(f\"  Num examples = {len(train_dataloader)}\")\n",
        "print(f\"  Num Epochs = {num_train_epochs}\")\n",
        "print(f\"  Instantaneous batch size per device = {train_batch_size}\")\n",
        "print(f\"  Total optimization steps = {max_train_steps}\")\n",
        "\n",
        "global_step = 0\n",
        "initial_global_step = 0\n",
        "\n",
        "progress_bar = tqdm(\n",
        "    range(0, max_train_steps),\n",
        "    initial=initial_global_step,\n",
        "    desc=\"Steps\",\n",
        "    position=0,\n",
        "    leave=True\n",
        ")\n",
        "\n",
        "losses = []\n",
        "for epoch in range(num_train_epochs):\n",
        "    for step, batch in enumerate(train_dataloader):\n",
        "\n",
        "        # Convert images to latent space\n",
        "        latents = vae.encode(batch[\"pixel_values\"].to(weight_dtype).to(device)).latent_dist.sample()\n",
        "\n",
        "        # Scale, do not worry about it\n",
        "        latents = latents * vae.config.scaling_factor\n",
        "\n",
        "        # Sample noise that we'll add to the latents\n",
        "        noise = torch.randn_like(latents)\n",
        "        batch_size = latents.shape[0]\n",
        "\n",
        "        # Sample a random timestep for each image in the batch\n",
        "        timesteps = torch.randint(0, noise_scheduler.config.num_train_timesteps, (batch_size,), device=latents.device)\n",
        "        timesteps = timesteps.long()\n",
        "\n",
        "        # Add noise to the latents according to the noise magnitude at each timestep\n",
        "        # (this is the forward diffusion process)\n",
        "        noisy_latents = noise_scheduler.add_noise(latents, noise, timesteps)\n",
        "\n",
        "        # Get the text embedding for conditioning\n",
        "        encoder_hidden_states = text_encoder(batch[\"input_ids\"].to(device), return_dict=False)[0]\n",
        "\n",
        "        # Predict the noise residual and compute loss\n",
        "        model_pred = unet(noisy_latents, timesteps, encoder_hidden_states, return_dict=False)[0]\n",
        "        loss = F.mse_loss(model_pred.float(), noise.float(), reduction=\"mean\")\n",
        "\n",
        "        # Backpropagate, and apply gradients\n",
        "        if train_UNET or train_VAE:\n",
        "            loss.backward()\n",
        "\n",
        "        # TODO 4: many times, the gradients have high variance, values and this creates instability. You might want to clip the gradients\n",
        "        # for the models that you train, e.g., unet, vae, or both.\n",
        "        # You might check the https://pytorch.org/docs/stable/generated/torch.nn.utils.clip_grad_norm_.html.\n",
        "        # The previous engineer was setting the max_norm to 1, but it's up to you. You can start with that value too.\n",
        "\n",
        "        optimizer.step()\n",
        "        optimizer.zero_grad()\n",
        "\n",
        "        ###############################################################\n",
        "\n",
        "        losses.append(loss.item())\n",
        "        progress_bar.update(1)\n",
        "        global_step += 1\n",
        "\n",
        "        ### Logging and correctness check\n",
        "        # TODO 5: First, you should probably show the average loss over time, as a mean of last 20 or so steps.\n",
        "        # Displaying only the last loss might confuse you\n",
        "        avg_losses = losses[-1]\n",
        "\n",
        "        progress_bar.set_postfix(average_loss=avg_losses, step=global_step)\n",
        "\n",
        "        # TODO 6:\n",
        "        # In the process of training diffusers it is very important to display after a certain number of steps the results and evaluate them with your eyes.\n",
        "        # Just try some prompts as in the intro notebook to see if are you really going to the correct direction.\n",
        "        # Many times in this case the loss is not as significant as the quality itself. You can use some of the intro code to display a selection of results here\n",
        "\n",
        "        # TODO 7: Remember that training could go...crazy. Try to save your best checkpoint, considering the loss and visual quality at some points.\n",
        "        # If that happens, remember to restart training. You can do something programatically, try to reload the model from start\n",
        "\n",
        "        if global_step >= max_train_steps:\n",
        "            break"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "f0550779-cdbf-4617-a9ed-51799484e783",
      "metadata": {
        "ExecuteTime": {
          "end_time": "2024-07-10T16:37:02.325122Z",
          "start_time": "2024-07-10T16:37:01.064027Z"
        },
        "id": "f0550779-cdbf-4617-a9ed-51799484e783"
      },
      "outputs": [],
      "source": [
        "# let's check a final  result\n",
        "prompt = \"A plane on the runway\"\n",
        "image = pipe(prompt, width=256, height=256).images[0]\n",
        "display(image.resize((512, 512)))\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "270abe8ea5bb5e06",
      "metadata": {
        "id": "270abe8ea5bb5e06"
      },
      "source": [
        "# Write your explanation first, and then submit the model\n",
        "\n",
        "# 300 words or less!!!!!!!\n",
        "My  model is just playing around for now. I need to work on to win the contest!"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "bbe4fab32a82f0ad",
      "metadata": {
        "id": "bbe4fab32a82f0ad"
      },
      "source": [
        "# Final submission code to HF hub"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "cfba9039-45d9-48b5-8657-905bb5bce221",
      "metadata": {
        "id": "cfba9039-45d9-48b5-8657-905bb5bce221"
      },
      "outputs": [],
      "source": [
        "\n",
        "pipe.push_to_hub(\"your_hf_id/your_model_name\", token=\"your_hf_token\")"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "provenance": [],
      "machine_shape": "hm",
      "gpuType": "L4"
    },
    "kernelspec": {
      "display_name": "Python 3",
      "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.5"
    },
    "accelerator": "GPU",
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "bc86d70ffa424be39f0aff0bee05ebaa": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "VBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "VBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "VBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_16026f5520b94e8d9b721874df4e1a21",
              "IPY_MODEL_2b2e3cddd9bc4e60ad31c708564e5690",
              "IPY_MODEL_08ab84d504c14d7bbf5fa512b784f03f",
              "IPY_MODEL_4808c81b7ad24dec8b1820479b2b039b"
            ],
            "layout": "IPY_MODEL_af69c16ea39448ee83d894e51febd27a"
          }
        },
        "7abee69fe25f427a9400596740c89447": {
          "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_30a7225d536b4284b6f45e9ba4b989c2",
            "placeholder": "​",
            "style": "IPY_MODEL_a79ffbb9258d450e9d5810f0d9fd1468",
            "value": "<center> <img\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.svg\nalt='Hugging Face'> <br> Copy a token from <a\nhref=\"https://huggingface.co/settings/tokens\" target=\"_blank\">your Hugging Face\ntokens page</a> and paste it below. <br> Immediately click login after copying\nyour token or it might be stored in plain text in this notebook file. </center>"
          }
        },
        "c4c070b4ac3b491893c47a0d04cef794": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "PasswordModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "PasswordModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "PasswordView",
            "continuous_update": true,
            "description": "Token:",
            "description_tooltip": null,
            "disabled": false,
            "layout": "IPY_MODEL_8cd9a72aa40744229dc3954abe7518d4",
            "placeholder": "​",
            "style": "IPY_MODEL_8ea10cadb7f643458c1c5115b8db7160",
            "value": ""
          }
        },
        "d42003f8fee1415baa7779a835df23ff": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "CheckboxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "CheckboxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "CheckboxView",
            "description": "Add token as git credential?",
            "description_tooltip": null,
            "disabled": false,
            "indent": true,
            "layout": "IPY_MODEL_2276a00f5cc84122a36135ab8a61d05e",
            "style": "IPY_MODEL_b0c75df0c98b4bff91107196ed020e7d",
            "value": true
          }
        },
        "f84d7883d61e4b59a2cdae7655bf5279": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ButtonModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ButtonModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ButtonView",
            "button_style": "",
            "description": "Login",
            "disabled": false,
            "icon": "",
            "layout": "IPY_MODEL_8a73a43d448a4d78a8bdafecdb60dbb5",
            "style": "IPY_MODEL_9133132c84434ce7818219dc08be7637",
            "tooltip": ""
          }
        },
        "845fffec68bb4f2fa61b7cb02dc6e985": {
          "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_b942c50600884f178718627d672db8ce",
            "placeholder": "​",
            "style": "IPY_MODEL_e510cce8dd8f4618af520827e0659ba8",
            "value": "\n<b>Pro Tip:</b> If you don't already have one, you can create a dedicated\n'notebooks' token with 'write' access, that you can then easily reuse for all\nnotebooks. </center>"
          }
        },
        "af69c16ea39448ee83d894e51febd27a": {
          "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": "center",
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": "flex",
            "flex": null,
            "flex_flow": "column",
            "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": "50%"
          }
        },
        "30a7225d536b4284b6f45e9ba4b989c2": {
          "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
          }
        },
        "a79ffbb9258d450e9d5810f0d9fd1468": {
          "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": ""
          }
        },
        "8cd9a72aa40744229dc3954abe7518d4": {
          "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
          }
        },
        "8ea10cadb7f643458c1c5115b8db7160": {
          "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": ""
          }
        },
        "2276a00f5cc84122a36135ab8a61d05e": {
          "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
          }
        },
        "b0c75df0c98b4bff91107196ed020e7d": {
          "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": ""
          }
        },
        "8a73a43d448a4d78a8bdafecdb60dbb5": {
          "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
          }
        },
        "9133132c84434ce7818219dc08be7637": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ButtonStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ButtonStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "button_color": null,
            "font_weight": ""
          }
        },
        "b942c50600884f178718627d672db8ce": {
          "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
          }
        },
        "e510cce8dd8f4618af520827e0659ba8": {
          "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": ""
          }
        },
        "c31fde39c8f64e7f930913b942e9ea64": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "LabelModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "LabelModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "LabelView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_955173ff70974180a3557ec8d4ab8aeb",
            "placeholder": "​",
            "style": "IPY_MODEL_3ed58b6380b0415a8866358e863b1e43",
            "value": "Connecting..."
          }
        },
        "955173ff70974180a3557ec8d4ab8aeb": {
          "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
          }
        },
        "3ed58b6380b0415a8866358e863b1e43": {
          "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": ""
          }
        },
        "16026f5520b94e8d9b721874df4e1a21": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "LabelModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "LabelModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "LabelView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_b0e9bb5b619b44cc896afc72c2bbb6c6",
            "placeholder": "​",
            "style": "IPY_MODEL_ae8a88118f9a43099ab1bd9855ba1e74",
            "value": "Token is valid (permission: write)."
          }
        },
        "2b2e3cddd9bc4e60ad31c708564e5690": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "LabelModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "LabelModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "LabelView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d62c3b1aac5a493ea1e97291b3d96606",
            "placeholder": "​",
            "style": "IPY_MODEL_c9f81c60939049cf96399fefabe95a9a",
            "value": "Your token has been saved in your configured git credential helpers (store)."
          }
        },
        "08ab84d504c14d7bbf5fa512b784f03f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "LabelModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "LabelModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "LabelView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_14c7fae5e3634da29526d2c695252e6c",
            "placeholder": "​",
            "style": "IPY_MODEL_30dfe81c74504ec1ae2e0e55d6b39327",
            "value": "Your token has been saved to /root/.cache/huggingface/token"
          }
        },
        "4808c81b7ad24dec8b1820479b2b039b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "LabelModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "LabelModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "LabelView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_17e0e58446cc4d01a0cc666dd77b141a",
            "placeholder": "​",
            "style": "IPY_MODEL_dd6cf72bc28d480ea77999f2ce6f2a52",
            "value": "Login successful"
          }
        },
        "b0e9bb5b619b44cc896afc72c2bbb6c6": {
          "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
          }
        },
        "ae8a88118f9a43099ab1bd9855ba1e74": {
          "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": ""
          }
        },
        "d62c3b1aac5a493ea1e97291b3d96606": {
          "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
          }
        },
        "c9f81c60939049cf96399fefabe95a9a": {
          "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": ""
          }
        },
        "14c7fae5e3634da29526d2c695252e6c": {
          "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
          }
        },
        "30dfe81c74504ec1ae2e0e55d6b39327": {
          "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": ""
          }
        },
        "17e0e58446cc4d01a0cc666dd77b141a": {
          "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
          }
        },
        "dd6cf72bc28d480ea77999f2ce6f2a52": {
          "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": ""
          }
        }
      }
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}