diff --git a/learn/lora-finetuning/LoRA_Finetuning_Demo.ipynb b/learn/lora-finetuning/LoRA_Finetuning_Demo.ipynb new file mode 100644 index 0000000..33622bb --- /dev/null +++ b/learn/lora-finetuning/LoRA_Finetuning_Demo.ipynb @@ -0,0 +1,1875 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "yQDVx85RkW3N" + }, + "source": [ + "# **Demo: Model Fine-tuning with Fireworks' LoRA**\n", + "\n", + "## **🎯 Overview**\n", + "\n", + "This demo shows how to use **Fireworks' LoRA fine-tuning** to customize a model for your specific use case. LoRA (Low-Rank Adaptation) is an efficient fine-tuning technique that allows you to adapt large language models while:\n", + "- πŸš€ Training fewer parameters\n", + "- πŸ’Ύ Using less memory\n", + "- ✨ Maintaining model quality\n", + "\n", + "We'll fine-tune a model on a customer support dataset to create an AI assistant that can handle support queries.\n", + "\n", + "## **πŸ”‘ Prerequisites**\n", + "\n", + "1. A Fireworks AI account (Sign up [here](https://fireworks.ai/login))\n", + "2. API key and Account ID:\n", + " - Log into your Fireworks account\n", + " - Click on the Profile Icon -> API Keys\n", + " - Create a new API key if you don't have one\n", + " - Note your Account ID beside the Profile Icon\n", + "\n", + "## **πŸ“š Understanding LoRA Fine-tuning**\n", + "\n", + "Before we begin, let's understand what makes a good fine-tuning project:\n", + "\n", + "1. **When to use LoRA:**\n", + " - You want to specialize a model for a specific domain\n", + " - You have high-quality, consistent training data\n", + " - You need faster training and lower resource usage than full fine-tuning\n", + "\n", + "## **πŸ“ Steps**\n", + "\n", + "1. πŸ› οΈ Setup and Installation\n", + "2. πŸ“Š Prepare the Dataset\n", + "3. ⚑ Fine-tune the Model\n", + "4. πŸ§ͺ Test and Evaluate\n", + "5. 🧹 Clean Up\n", + "\n", + "Let's get started!" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "wEi02we8kW3P" + }, + "source": [ + "## 1. **πŸ› οΈ Setup and Installation**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "l66pSB8VkW3P", + "outputId": "cbacc014-de92-4fe6-e461-e52ded6ee2f2" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Collecting fireworks-ai\n", + " Downloading fireworks_ai-0.15.12-py3-none-any.whl.metadata (5.7 kB)\n", + "Collecting datasets\n", + " Downloading datasets-3.2.0-py3-none-any.whl.metadata (20 kB)\n", + "Requirement already satisfied: httpx in /usr/local/lib/python3.11/dist-packages (from fireworks-ai) (0.28.1)\n", + "Collecting httpx-ws (from fireworks-ai)\n", + " Downloading httpx_ws-0.7.1-py3-none-any.whl.metadata (9.2 kB)\n", + "Collecting httpx_sse (from fireworks-ai)\n", + " Downloading httpx_sse-0.4.0-py3-none-any.whl.metadata (9.0 kB)\n", + "Requirement already satisfied: pydantic in /usr/local/lib/python3.11/dist-packages (from fireworks-ai) (2.10.5)\n", + "Requirement already satisfied: Pillow in /usr/local/lib/python3.11/dist-packages (from fireworks-ai) (11.1.0)\n", + "Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from datasets) (3.17.0)\n", + "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.11/dist-packages (from datasets) (1.26.4)\n", + "Requirement already satisfied: pyarrow>=15.0.0 in /usr/local/lib/python3.11/dist-packages (from datasets) (17.0.0)\n", + "Collecting dill<0.3.9,>=0.3.0 (from datasets)\n", + " Downloading dill-0.3.8-py3-none-any.whl.metadata (10 kB)\n", + "Requirement already satisfied: pandas in /usr/local/lib/python3.11/dist-packages (from datasets) (2.2.2)\n", + "Requirement already satisfied: requests>=2.32.2 in /usr/local/lib/python3.11/dist-packages (from datasets) (2.32.3)\n", + "Requirement already satisfied: tqdm>=4.66.3 in /usr/local/lib/python3.11/dist-packages (from datasets) (4.67.1)\n", + "Collecting xxhash (from datasets)\n", + " Downloading xxhash-3.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + "Collecting multiprocess<0.70.17 (from datasets)\n", + " Downloading multiprocess-0.70.16-py311-none-any.whl.metadata (7.2 kB)\n", + "Collecting fsspec<=2024.9.0,>=2023.1.0 (from fsspec[http]<=2024.9.0,>=2023.1.0->datasets)\n", + " Downloading fsspec-2024.9.0-py3-none-any.whl.metadata (11 kB)\n", + "Requirement already satisfied: aiohttp in /usr/local/lib/python3.11/dist-packages (from datasets) (3.11.11)\n", + "Requirement already satisfied: huggingface-hub>=0.23.0 in /usr/local/lib/python3.11/dist-packages (from datasets) (0.27.1)\n", + "Requirement already satisfied: packaging in /usr/local/lib/python3.11/dist-packages (from datasets) (24.2)\n", + "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/dist-packages (from datasets) (6.0.2)\n", + "Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /usr/local/lib/python3.11/dist-packages (from aiohttp->datasets) (2.4.4)\n", + "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.11/dist-packages (from aiohttp->datasets) (1.3.2)\n", + "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.11/dist-packages (from aiohttp->datasets) (24.3.0)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.11/dist-packages (from aiohttp->datasets) (1.5.0)\n", + "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.11/dist-packages (from aiohttp->datasets) (6.1.0)\n", + "Requirement already satisfied: propcache>=0.2.0 in /usr/local/lib/python3.11/dist-packages (from aiohttp->datasets) (0.2.1)\n", + "Requirement already satisfied: yarl<2.0,>=1.17.0 in /usr/local/lib/python3.11/dist-packages (from aiohttp->datasets) (1.18.3)\n", + "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.23.0->datasets) (4.12.2)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.2->datasets) (3.4.1)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.2->datasets) (3.10)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.2->datasets) (2.3.0)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.2->datasets) (2024.12.14)\n", + "Requirement already satisfied: anyio in /usr/local/lib/python3.11/dist-packages (from httpx->fireworks-ai) (3.7.1)\n", + "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.11/dist-packages (from httpx->fireworks-ai) (1.0.7)\n", + "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.11/dist-packages (from httpcore==1.*->httpx->fireworks-ai) (0.14.0)\n", + "Collecting anyio (from httpx->fireworks-ai)\n", + " Downloading anyio-4.8.0-py3-none-any.whl.metadata (4.6 kB)\n", + "Collecting wsproto (from httpx-ws->fireworks-ai)\n", + " Downloading wsproto-1.2.0-py3-none-any.whl.metadata (5.6 kB)\n", + "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/dist-packages (from pandas->datasets) (2.8.2)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.11/dist-packages (from pandas->datasets) (2024.2)\n", + "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.11/dist-packages (from pandas->datasets) (2025.1)\n", + "Requirement already satisfied: annotated-types>=0.6.0 in /usr/local/lib/python3.11/dist-packages (from pydantic->fireworks-ai) (0.7.0)\n", + "Requirement already satisfied: pydantic-core==2.27.2 in /usr/local/lib/python3.11/dist-packages (from pydantic->fireworks-ai) (2.27.2)\n", + "Requirement already satisfied: sniffio>=1.1 in /usr/local/lib/python3.11/dist-packages (from anyio->httpx->fireworks-ai) (1.3.1)\n", + "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/dist-packages (from python-dateutil>=2.8.2->pandas->datasets) (1.17.0)\n", + "Downloading fireworks_ai-0.15.12-py3-none-any.whl (111 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m111.1/111.1 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading datasets-3.2.0-py3-none-any.whl (480 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m480.6/480.6 kB\u001b[0m \u001b[31m18.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading dill-0.3.8-py3-none-any.whl (116 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m116.3/116.3 kB\u001b[0m \u001b[31m7.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading fsspec-2024.9.0-py3-none-any.whl (179 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m179.3/179.3 kB\u001b[0m \u001b[31m11.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading multiprocess-0.70.16-py311-none-any.whl (143 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m143.5/143.5 kB\u001b[0m \u001b[31m10.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading httpx_sse-0.4.0-py3-none-any.whl (7.8 kB)\n", + "Downloading httpx_ws-0.7.1-py3-none-any.whl (14 kB)\n", + "Downloading xxhash-3.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m194.8/194.8 kB\u001b[0m \u001b[31m16.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading anyio-4.8.0-py3-none-any.whl (96 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m96.0/96.0 kB\u001b[0m \u001b[31m8.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading wsproto-1.2.0-py3-none-any.whl (24 kB)\n", + "Installing collected packages: xxhash, wsproto, httpx_sse, fsspec, dill, anyio, multiprocess, httpx-ws, fireworks-ai, datasets\n", + " Attempting uninstall: fsspec\n", + " Found existing installation: fsspec 2024.10.0\n", + " Uninstalling fsspec-2024.10.0:\n", + " Successfully uninstalled fsspec-2024.10.0\n", + " Attempting uninstall: anyio\n", + " Found existing installation: anyio 3.7.1\n", + " Uninstalling anyio-3.7.1:\n", + " Successfully uninstalled anyio-3.7.1\n", + "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", + "gcsfs 2024.10.0 requires fsspec==2024.10.0, but you have fsspec 2024.9.0 which is incompatible.\n", + "jupyter-server 1.24.0 requires anyio<4,>=3.1.0, but you have anyio 4.8.0 which is incompatible.\u001b[0m\u001b[31m\n", + "\u001b[0mSuccessfully installed anyio-4.8.0 datasets-3.2.0 dill-0.3.8 fireworks-ai-0.15.12 fsspec-2024.9.0 httpx-ws-0.7.1 httpx_sse-0.4.0 multiprocess-0.70.16 wsproto-1.2.0 xxhash-3.5.0\n" + ] + } + ], + "source": [ + "# Install the Fireworks and Datasets libraries\n", + "!pip install fireworks-ai datasets\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "Nsvt6fctk292" + }, + "outputs": [], + "source": [ + "# Import Libraries\n", + "from google.colab import drive\n", + "from datasets import load_dataset\n", + "import requests\n", + "import os\n", + "import json" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "D16GLT9WkW3Q" + }, + "outputs": [], + "source": [ + "# Configure Fireworks credentials\n", + "API_KEY = \"YOUR_API_KEY\" # Replace with your API key\n", + "ACCOUNT_ID = \"YOUR_ACCOUNT_ID\" # Replace with your account ID\n", + "HEADERS = {\"Authorization\": f\"Bearer {API_KEY}\"}\n", + "HEADERS_WITH_CONTENT_TYPE = {\n", + " \"Authorization\": f\"Bearer {API_KEY}\",\n", + " \"Content-Type\": \"application/json\"\n", + "}\n", + "\n", + "# Project configuration\n", + "BASE_URL = f\"https://api.fireworks.ai/v1/accounts/{ACCOUNT_ID}\"\n", + "BASE_MODEL = \"accounts/fireworks/models/llama-v3p1-8b-instruct\"\n", + "DATASET_ID = \"customer-support-demo\"\n", + "OUTPUT_MODEL = \"customer-support-assistant\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "bLtXpr4v5fAg" + }, + "source": [ + "## 2. **πŸ“Š Prepare the Dataset**\n", + "\n", + "### Understanding the Data Format\n", + "\n", + "The dataset schema needs to conform to the OpenAI-compatible Chat Completions API. Each example should be a JSON object with:\n", + "- A system message defining the assistant's role\n", + "- A user message (input)\n", + "- An assistant message (desired output)\n", + "\n", + "Here's what good training data looks like:\n", + "\n", + "```python\n", + "{\n", + " \"messages\": [\n", + " {\"role\": \"system\", \"content\": \"You are a helpful customer support assistant.\"},\n", + " {\"role\": \"user\", \"content\": \"How do I reset my password?\"},\n", + " {\"role\": \"assistant\", \"content\": \"I can help you reset your password. Please follow these steps...\"}\n", + " ]\n", + "}\n", + "```\n", + "\n", + "### Loading and Formatting Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 294, + "referenced_widgets": [ + "5144be018c904c81956efb4edfef8c83", + "fbd3d8f48bfe4c95925d71ba9865c72f", + "dafcf6fc5d4641878f3df75640131320", + "10451358bc2f4a73bc0baa3cd6d52575", + "d9f64a3be5384bb5b7ef6f3b0015e980", + "49c3fdd8466a454e9efdacfa7d2ae165", + "0e3a4977256e4bb38776d5e5d04dd4e0", + "abb80c1fd4844a68a4e45625bf478524", + "b71ca376c39646adbe70ad0e15252452", + "de6ca9ea95084296b98b2db733cb279b", + "fb99ff643c5e480dbc3f85ec993ba7b9", + "4fa6c39972d642909732a4ec3b4cfa06", + "873fc45ca4374407a95e251c75853f88", + "5805d7ed2afe4c92a4da8aea6b059ac1", + "95af30a417674fdd9c8c925dae55d8ce", + "2ae206e0f92843a1b269b0dc750e4e33", + "3bbb1e1943f44916a35750488d6c0586", + "72efddb62bf14f5296a1195ce8bab409", + "8fd2fca8f2274baba956ea3398df42f8", + "fd9c6efc885c482fb2fd86c187550904", + "2a49b305bc734a69ae514d5960ccb96a", + "7ad3d2bdaed6488eb7361a68b1841a41", + "03c9b309cbea47a1aa40b7705e0b2ae6", + "f99f29df5e4e4b13a05d462e46a30d63", + "7b0cc88702554a9781b5da72833e6e22", + "01c7b529d8f142af80f59b11ae598b17", + "2368a85a13d2430288476fb276655595", + "9ed58d103c80417dab5a5eb54b8efae0", + "775d20ed4fae439a8330df2960b3ad01", + "63f6b52733a84fac8ef28f8735192f21", + "1395b75bfe25461f84d8f47345c23447", + "df9452ef38ca403598820290e885b9fd", + "d63798fb52834accbc2ddfc2d535cba5" + ] + }, + "id": "ptnrzzhKkW3Q", + "outputId": "c604e1c4-fcd7-40fb-816c-3e9c09121990" + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_auth.py:94: UserWarning: \n", + "The secret `HF_TOKEN` does not exist in your Colab secrets.\n", + "To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n", + "You will be able to reuse this secret in all of your notebooks.\n", + "Please note that authentication is recommended but still optional to access public models or datasets.\n", + " warnings.warn(\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "5144be018c904c81956efb4edfef8c83", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "README.md: 0%| | 0.00/11.9k [00:00] 16.40M --.-KB/s in 0.1s \n", + "\n", + "2025-01-27 18:31:26 (111 MB/s) - β€˜firectl.gz’ saved [17197919/17197919]\n", + "\n" + ] + } + ], + "source": [ + "# install firectl\n", + "!wget -O firectl.gz https://storage.googleapis.com/fireworks-public/firectl/stable/linux-amd64.gz\n", + "!gunzip firectl.gz\n", + "!sudo install -o root -g root -m 0755 firectl /usr/local/bin/firectl" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "DVLBoyNbo_PB" + }, + "outputs": [], + "source": [ + "!firectl set-api-key {API_KEY} -a {ACCOUNT_ID}" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "TMzFpRxMAwzJ" + }, + "source": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "pSVMwEOv6qaC" + }, + "source": [ + "## 3. **⚑ Fine-tune the Model**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "NQjIakNgkW3Q", + "outputId": "740b1ed7-8dda-4b1b-87e0-269220305540" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2025/01/24 23:36:12 Failed to execute: error creating dataset: rpc error: code = AlreadyExists desc = dataset with the same name already exists\n", + "Starting basic fine-tuning...\n", + "Name: accounts/fireworks/supervisedFineTuningJobs/8b037a38\n", + "Create Time: 2025-01-24 23:36:12\n", + "Dataset: accounts/fireworks/datasets/customer-support-demo\n", + "State: JOB_STATE_VALIDATING\n", + "Status: OK\n", + "Created By: andre@fireworks.ai\n", + "Output Model: accounts/fireworks/models/customer-support-assistant\n", + "Base Model: accounts/fireworks/models/llama-v3p1-8b-instruct\n", + "Learning Rate: 0\n", + "Max Context Length: 8192\n", + "Lora Rank: 8\n", + "Wandb Config:\n" + ] + } + ], + "source": [ + "# First, create the dataset on Fireworks\n", + "!firectl -a {ACCOUNT_ID} create dataset {DATASET_ID} support_dataset.jsonl\n", + "\n", + "# Let's explore the key tuning parameters:\n", + "\n", + "# Basic fine-tuning (using defaults)\n", + "print(\"Starting basic fine-tuning...\")\n", + "!firectl -a {ACCOUNT_ID} create sftj \\\n", + " --base-model {BASE_MODEL} \\\n", + " --dataset {DATASET_ID} \\\n", + " --output-model {OUTPUT_MODEL}" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "K6HOeMQYnpwJ" + }, + "source": [ + "Key Parameters Explained:\n", + "------------------------\n", + "- epochs: Number of training passes (default=1)\n", + " - Increase if model needs more training (max 3)\n", + " - Example: --epochs 2\n", + "\n", + "- learning-rate: Controls update speed (default is model-specific)\n", + " - Usually best to keep default\n", + " - Example: --learning-rate 0.0001\n", + "\n", + "- lora-rank: Number of trainable parameters (default=8)\n", + " - Must be power of 2, up to 64\n", + " - Higher = more capacity but slower\n", + " - Example: --lora-rank 16\n", + "\n", + "- early-stop: Stops if not improving\n", + " - Optional flag\n", + " - Example: --early-stop\n", + "\n", + "- max-context-length: Maximum input length\n", + " - Default is 8k\n", + " - Example: --max-context-length 16000" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "XscU0CSfroMs" + }, + "outputs": [], + "source": [ + "config = {\n", + " # LoRA specific settings\n", + " 'lora_rank': 8, # Must be power of 2, up to 64 (default: 8) increase to increase the amount of information captured while tuning\n", + " 'learning_rate': 1e-4, # recommended not to change\n", + " 'epochs': 1, # increase if not following training data as expected\n", + "\n", + " # Optional settings\n", + " 'max_context_length': 8192,\n", + " 'early_stop': False,\n", + " # 'evaluation_dataset': 'my_eval_dataset' # You may upload your own evaluation dataset\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Jc6ajbPSn1RF", + "outputId": "b8005958-957a-4b48-b4d0-e4a9d641ad03" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Name: accounts/fireworks/supervisedFineTuningJobs/7caa8cc0\n", + "Create Time: 2025-01-24 23:55:06\n", + "Dataset: accounts/fireworks/datasets/customer-support-demo\n", + "State: JOB_STATE_VALIDATING\n", + "Status: OK\n", + "Created By: andre@fireworks.ai\n", + "Output Model: accounts/fireworks/models/customer-support-assistant-custom\n", + "Base Model: accounts/fireworks/models/llama-v3p1-8b-instruct\n", + "Epochs: 1\n", + "Learning Rate: 0.0001\n", + "Max Context Length: 8192\n", + "Lora Rank: 8\n", + "Wandb Config:\n", + "2025/01/24 23:55:06 Failed to execute: rpc error: code = NotFound desc = resource not found\n" + ] + } + ], + "source": [ + "# Example with custom parameters\n", + "!firectl create sftj \\\n", + " --base-model {BASE_MODEL} \\\n", + " --dataset {DATASET_ID} \\\n", + " --output-model {OUTPUT_MODEL}-custom \\\n", + " --epochs {config['epochs']} \\\n", + " --learning-rate {config['learning_rate']} \\\n", + " --lora-rank {config['lora_rank']} \\\n", + " --max-context-length {config['max_context_length']}\\\n", + " {'--early-stop' if config['early_stop'] else ''}\\\n", + " -a {ACCOUNT_ID}\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "NlphD5MR-61V" + }, + "source": [ + "You can access the fine tuning job ID from your account's [deployments](https://fireworks.ai/dashboard/fine-tuning). This lets you monitor the training progress of the job." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "HwUPL23GwJ9k", + "outputId": "9bfce965-9403-48fa-94b0-d5d833de56c5" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Name: accounts/fireworks/supervisedFineTuningJobs/7caa8cc0\n", + "Create Time: 2025-01-24 23:55:06\n", + "Dataset: accounts/fireworks/datasets/customer-support-demo\n", + "State: JOB_STATE_COMPLETED\n", + "Status: OK\n", + "Created By: andre@fireworks.ai\n", + "Output Model: accounts/fireworks/models/customer-support-assistant-custom\n", + "Base Model: accounts/fireworks/models/llama-v3p1-8b-instruct\n", + "Epochs: 1\n", + "Learning Rate: 0.0001\n", + "Max Context Length: 8192\n", + "Lora Rank: 8\n", + "Wandb Config:\n" + ] + } + ], + "source": [ + "# Monitor training progress\n", + "!firectl -a {ACCOUNT_ID} get supervised-fine-tuning-job 7caa8cc0" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ypZlQO1d62dn" + }, + "source": [ + "## 4. πŸ§ͺ Deploy and Test the Fine-tuned Model\n", + "\n", + "Deploy the model so that we can test it.\n", + "On Fireworks, we support serverless LoRA addons for [these models](https://docs.fireworks.ai/fine-tuning/fine-tuning-models#supported-base-models-loras-on-serverless)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "JUaQEGDfkW3Q" + }, + "outputs": [], + "source": [ + "# Deploy the model (required before inference)\n", + "!firectl -a {ACCOUNT_ID} deploy {OUTPUT_MODEL}-custom" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "vWeACIS6CVLN" + }, + "outputs": [], + "source": [ + "!firectl -a {ACCOUNT_ID} deploy {OUTPUT_MODEL}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "9u2Lk1-NCTlO", + "outputId": "654bae89-f78d-41a5-b0da-37486907525e" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Testing the fine-tuned model:\n", + "\n", + "Query: How do I reset my password?\n", + "Response: I'll get right on it! I'm here to guide you through the process of resetting your password.\n", + "\n", + "1. **Access the Password Reset Page**: Start by visiting the login screen of our platform. You'll find a link to the password reset page, which will prompt you to enter your email address.\n", + "2. **Enter Your Email**: Enter the email address you used when you signed up for our platform.\n", + "3. **Click on the Reset Password Button**: Once you've entered your email address, click on the \"Reset Password\" button.\n", + "4. **Check Your Email**: Keep an eye on your email inbox, including the spam or junk folder, for a message titled \"Password Reset\" or something similar. If you don't see it within a few minutes, please check your phone or other email accounts as well.\n", + "5. **Click on the Reset Link**: Open the email and click on the \"Reset Password\" or \"Click Here\" link provided.\n", + "6. **Create a New Password**: Follow the instructions in the email to create a new password. Make sure to choose a strong and unique password that is easy for you to remember but difficult for others to guess.\n", + "7. **Verify and Retrieve Your Password**: Once you've created your new password, you'll be able to log in using your new credentials.\n", + "\n", + "If you encounter any issues or if you need further assistance, please don't hesitate to let me know. I'm here to help you throughout the entire process!\n", + "\n", + "Query: What's your return policy?\n", + "Response: Definitely! I'd be happy to provide you with details about our return policy.\n", + "\n", + "Our return policy is designed to offer maximum satisfaction to our valued customers. Here are the key elements:\n", + "\n", + "1. **Product/Service Dissatisfaction:** If you are dissatisfied with the product or service you received from us, we offer a return policy to provide a suitable resolution. Please follow the specific instructions outlined below to initiate the return process.\n", + "2. **Product/Service Defect:** In the unfortunate event that your product or service is defective, we will definitely address the issue promptly. You can reach out to our customer support team for further assistance.\n", + "3. **Cancellation within Grace Period:** If you change your mind and want to cancel your purchase within the specified grace period, we will gladly assist you. Please note that the grace period may vary depending on the type of product or service.\n", + "4. **Order Cancellations:** If you encounter circumstances that prevent you from receiving your order, such as unforeseen events or delivery complications, rest assured that we will work towards resolving the issue.\n", + "5. **Shipping Issues:** In case there are any complications with the shipping process or if your order arrives in a damaged condition, we will do our best to rectify the situation.\n", + "6. **Account-Related Issues:** If you encounter any difficulties with your account or have concerns about our services, I strongly recommend reaching out to our dedicated customer support team for immediate assistance.\n", + "7. **Subscription Services:** For subscription-based services, you can cancel your subscription at any time by following the required procedures. Keep in mind that any cancellation fees or penalties may apply depending on your specific subscription terms.\n", + "\n", + "Please keep in mind that individual circumstances may vary depending on the nature of your purchase, the product or service involved, and the policies of our respective vendors or service providers. To obtain more specific information or to initiate a return, cancellation, or account issue resolution, please provide us with your order details, such as the purchase number or any relevant account information, and our dedicated customer support team will be delighted to assist you.\n", + "\n", + "Thank you for your understanding and for allowing us the opportunity to address your concern.\n", + "\n", + "Query: I haven't received my order yet\n", + "Response: Firstly, we want to assure you that we understand your concern about not receiving your order yet. It can be frustrating when you haven't received your order as expected. To help us better assist you, could you please provide us with the {{Order Number}} or {{Tracking Number}} so that we can investigate the status of your order? With this information, we'll be able to provide you with an update on your order's location and estimated delivery date. Your satisfaction is our top priority, and we're here to help resolve any issues you may have.\n" + ] + } + ], + "source": [ + "# Test with example queries\n", + "\n", + "def test_model(query):\n", + " \"\"\"Test the fine-tuned model with a customer support query\"\"\"\n", + " headers = {\n", + " \"Authorization\": f\"Bearer {API_KEY}\",\n", + " \"Content-Type\": \"application/json\"\n", + " }\n", + "\n", + " payload = {\n", + " \"model\": f\"accounts/{ACCOUNT_ID}/models/{OUTPUT_MODEL}-custom\",\n", + " # \"model\": f\"accounts/{ACCOUNT_ID}/models/{OUTPUT_MODEL}\", you can test between the addon with adjusted parameters and the default fine-tuned LoRA\n", + " \"messages\": [\n", + " {\n", + " \"role\": \"user\",\n", + " \"content\": query\n", + " }\n", + " ]\n", + " }\n", + "\n", + " response = requests.post(\n", + " \"https://api.fireworks.ai/inference/v1/chat/completions\",\n", + " headers=headers,\n", + " data=json.dumps(payload)\n", + " )\n", + "\n", + " return response.json()[\"choices\"][0][\"message\"][\"content\"]\n", + "\n", + "# Test examples\n", + "test_queries = [\n", + " \"How do I reset my password?\",\n", + " \"What's your return policy?\",\n", + " \"I haven't received my order yet\"\n", + "]\n", + "\n", + "print(\"Testing the fine-tuned model:\")\n", + "for query in test_queries:\n", + " print(f\"\\nQuery: {query}\")\n", + " print(f\"Response: {test_model(query)}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ZBeP-nGOFgda" + }, + "source": [ + "You may encounter an error stating that the model is inaccessible/undeployed. If that's the case, check out [your models](https://fireworks.ai/dashboard/models) to see the status of deployment." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "XBq8f78269rm" + }, + "source": [ + "# 5. **🧹 Clean Up**\n", + "\n", + "Now you can delete all resources you have created. The order of deletion does not matter, except the model needs to be undeployed before you can delete it." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "MH5pm8-VkW3Q" + }, + "outputs": [], + "source": [ + "# Undeploy model\n", + "!firectl -a {ACCOUNT_ID} undeploy {OUTPUT_MODEL}\n", + "!firectl -a {ACCOUNT_ID} undeploy {OUTPUT_MODEL}-custom" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "cKsqWUH8FzRq" + }, + "outputs": [], + "source": [ + "# Delete model (optional)\n", + "!firectl -a {ACCOUNT_ID} delete model {OUTPUT_MODEL}\n", + "!firectl -a {ACCOUNT_ID} delete model {OUTPUT_MODEL}-custom" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "7z1aSIAdF3Pz" + }, + "outputs": [], + "source": [ + "# Delete dataset\n", + "!firectl -a {ACCOUNT_ID} delete dataset {DATASET_ID}" + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "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.10.16" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "01c7b529d8f142af80f59b11ae598b17": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "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_df9452ef38ca403598820290e885b9fd", + "placeholder": "​", + "style": "IPY_MODEL_d63798fb52834accbc2ddfc2d535cba5", + "value": " 26872/26872 [00:00<00:00, 76734.62 examples/s]" + } + }, + "03c9b309cbea47a1aa40b7705e0b2ae6": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_f99f29df5e4e4b13a05d462e46a30d63", + "IPY_MODEL_7b0cc88702554a9781b5da72833e6e22", + "IPY_MODEL_01c7b529d8f142af80f59b11ae598b17" + ], + "layout": "IPY_MODEL_2368a85a13d2430288476fb276655595" + } + }, + "0e3a4977256e4bb38776d5e5d04dd4e0": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "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": "" + } + }, + "10451358bc2f4a73bc0baa3cd6d52575": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "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_de6ca9ea95084296b98b2db733cb279b", + "placeholder": "​", + "style": "IPY_MODEL_fb99ff643c5e480dbc3f85ec993ba7b9", + "value": " 11.9k/11.9k [00:00<00:00, 475kB/s]" + } + }, + "1395b75bfe25461f84d8f47345c23447": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "2368a85a13d2430288476fb276655595": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "2a49b305bc734a69ae514d5960ccb96a": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "2ae206e0f92843a1b269b0dc750e4e33": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "3bbb1e1943f44916a35750488d6c0586": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "49c3fdd8466a454e9efdacfa7d2ae165": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "4fa6c39972d642909732a4ec3b4cfa06": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_873fc45ca4374407a95e251c75853f88", + "IPY_MODEL_5805d7ed2afe4c92a4da8aea6b059ac1", + "IPY_MODEL_95af30a417674fdd9c8c925dae55d8ce" + ], + "layout": "IPY_MODEL_2ae206e0f92843a1b269b0dc750e4e33" + } + }, + "5144be018c904c81956efb4edfef8c83": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_fbd3d8f48bfe4c95925d71ba9865c72f", + "IPY_MODEL_dafcf6fc5d4641878f3df75640131320", + "IPY_MODEL_10451358bc2f4a73bc0baa3cd6d52575" + ], + "layout": "IPY_MODEL_d9f64a3be5384bb5b7ef6f3b0015e980" + } + }, + "5805d7ed2afe4c92a4da8aea6b059ac1": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "success", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_8fd2fca8f2274baba956ea3398df42f8", + "max": 19202474, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_fd9c6efc885c482fb2fd86c187550904", + "value": 19202474 + } + }, + "63f6b52733a84fac8ef28f8735192f21": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "72efddb62bf14f5296a1195ce8bab409": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "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": "" + } + }, + "775d20ed4fae439a8330df2960b3ad01": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "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": "" + } + }, + "7ad3d2bdaed6488eb7361a68b1841a41": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "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": "" + } + }, + "7b0cc88702554a9781b5da72833e6e22": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "success", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_63f6b52733a84fac8ef28f8735192f21", + "max": 26872, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_1395b75bfe25461f84d8f47345c23447", + "value": 26872 + } + }, + "873fc45ca4374407a95e251c75853f88": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "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_3bbb1e1943f44916a35750488d6c0586", + "placeholder": "​", + "style": "IPY_MODEL_72efddb62bf14f5296a1195ce8bab409", + "value": "(…)t_Training_Dataset_27K_responses-v11.csv: 100%" + } + }, + "8fd2fca8f2274baba956ea3398df42f8": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "95af30a417674fdd9c8c925dae55d8ce": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "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_2a49b305bc734a69ae514d5960ccb96a", + "placeholder": "​", + "style": "IPY_MODEL_7ad3d2bdaed6488eb7361a68b1841a41", + "value": " 19.2M/19.2M [00:00<00:00, 29.9MB/s]" + } + }, + "9ed58d103c80417dab5a5eb54b8efae0": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "abb80c1fd4844a68a4e45625bf478524": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "b71ca376c39646adbe70ad0e15252452": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "d63798fb52834accbc2ddfc2d535cba5": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "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": "" + } + }, + "d9f64a3be5384bb5b7ef6f3b0015e980": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "dafcf6fc5d4641878f3df75640131320": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "success", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_abb80c1fd4844a68a4e45625bf478524", + "max": 11949, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_b71ca376c39646adbe70ad0e15252452", + "value": 11949 + } + }, + "de6ca9ea95084296b98b2db733cb279b": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "df9452ef38ca403598820290e885b9fd": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "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 + } + }, + "f99f29df5e4e4b13a05d462e46a30d63": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "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_9ed58d103c80417dab5a5eb54b8efae0", + "placeholder": "​", + "style": "IPY_MODEL_775d20ed4fae439a8330df2960b3ad01", + "value": "Generating train split: 100%" + } + }, + "fb99ff643c5e480dbc3f85ec993ba7b9": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "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": "" + } + }, + "fbd3d8f48bfe4c95925d71ba9865c72f": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "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_49c3fdd8466a454e9efdacfa7d2ae165", + "placeholder": "​", + "style": "IPY_MODEL_0e3a4977256e4bb38776d5e5d04dd4e0", + "value": "README.md: 100%" + } + }, + "fd9c6efc885c482fb2fd86c187550904": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + } + } + } + }, + "nbformat": 4, + "nbformat_minor": 0 +}