From cca598e1f0e387732186d3ddd8e0503686bf0e26 Mon Sep 17 00:00:00 2001 From: Denis Rothman <30811222+Denis2054@users.noreply.github.com> Date: Thu, 4 Jan 2024 06:02:43 +0100 Subject: [PATCH] Delete Chapter07/Fine_tuning_GPT_3.ipynb --- Chapter07/Fine_tuning_GPT_3.ipynb | 2944 ----------------------------- 1 file changed, 2944 deletions(-) delete mode 100644 Chapter07/Fine_tuning_GPT_3.ipynb diff --git a/Chapter07/Fine_tuning_GPT_3.ipynb b/Chapter07/Fine_tuning_GPT_3.ipynb deleted file mode 100644 index 67e972f..0000000 --- a/Chapter07/Fine_tuning_GPT_3.ipynb +++ /dev/null @@ -1,2944 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "3eKj0dub1XC5" - }, - "source": [ - "#Fine-Tuning GPT-3\n", - "\n", - "Copyright 2023 Denis Rothman\n", - "\n", - "**September 10,2023 update**\n", - "As of January 4,2024, [OpenAI deprecations](https://platform.openai.com/docs/deprecations) apply to fine-tuning ```ada```. The recommended replacement is ```babbage-002``` which has been implemented in this notebook along with code adaptations: data preparation and fine-tuning.\n", - "\n", - "[OpenAI fine-tuning documentation](https://beta.openai.com/docs/guides/fine-tuning/)\n", - "\n", - "Check the cost of fine-tuning your dataset on OpenAI before running the notebook.\n", - "\n", - "Run this notebook cell by cell to:\n", - "\n", - "1.prepare data\n", - "2.fine-tune a model\n", - "3.run a fine-tuned model\n", - "4.manage the fine-tunes" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "s9VPzFA02q9Z" - }, - "source": [ - "## Installing OpenAI & Wandb\n", - "\n", - "Restart the runtime after installing openai and run the cell again to make sur that \"import openai\" is executed." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "maEF3GMf1We6", - "outputId": "ecb4b048-d6de-4b0b-9e52-59296fa7f032" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Collecting openai\n", - " Downloading openai-0.27.9-py3-none-any.whl (75 kB)\n", - "\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/75.5 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[91m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[91m╸\u001b[0m\u001b[90m━━\u001b[0m \u001b[32m71.7/75.5 kB\u001b[0m \u001b[31m2.4 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.5/75.5 kB\u001b[0m \u001b[31m1.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: requests>=2.20 in /usr/local/lib/python3.10/dist-packages (from openai) (2.31.0)\n", - "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from openai) (4.66.1)\n", - "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from openai) (3.8.5)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai) (3.2.0)\n", - "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai) (3.4)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai) (2.0.4)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai) (2023.7.22)\n", - "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai) (23.1.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai) (6.0.4)\n", - "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai) (4.0.3)\n", - "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai) (1.9.2)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai) (1.4.0)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai) (1.3.1)\n", - "Installing collected packages: openai\n", - "Successfully installed openai-0.27.9\n" - ] - } - ], - "source": [ - "try:\n", - " import openai\n", - "except:\n", - " !pip install openai\n", - " import openai" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "-bfKMG4M29U4" - }, - "source": [ - "## Your API Key" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Eb6gFplQqU5v", - "outputId": "fcad26a3-2299-4027-c138-c4d04e22960d" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Mounted at /content/drive\n" - ] - } - ], - "source": [ - "#You can retrieve your API key from a file(1)\n", - "# or enter it manually(2)\n", - "\n", - "#Comment this cell if you want to enter your key manually.\n", - "#(1)Retrieve the API Key from a file\n", - "#Store you key in a file and read it(you can type it directly in the notebook but it will be visible for somebody next to you)\n", - "from google.colab import drive\n", - "drive.mount('/content/drive')\n", - "f = open(\"drive/MyDrive/files/api_key.txt\", \"r\")\n", - "API_KEY=f.readline()\n", - "f.close()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "LwacvzYC5ZxQ" - }, - "outputs": [], - "source": [ - "#(2) Enter your manually by\n", - "# replacing API_KEY by your key.\n", - "#The OpenAI Key\n", - "import os\n", - "os.environ['OPENAI_API_KEY'] =API_KEY\n", - "openai.api_key = os.getenv(\"OPENAI_API_KEY\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "cipgQQrUkLfu", - "outputId": "9190e8c9-abb5-49c0-cccf-f81d1457e3d5" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Collecting wandb\n", - " Downloading wandb-0.15.9-py3-none-any.whl (2.1 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.1/2.1 MB\u001b[0m \u001b[31m11.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: Click!=8.0.0,>=7.1 in /usr/local/lib/python3.10/dist-packages (from wandb) (8.1.7)\n", - "Collecting GitPython!=3.1.29,>=1.0.0 (from wandb)\n", - " Downloading GitPython-3.1.32-py3-none-any.whl (188 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m188.5/188.5 kB\u001b[0m \u001b[31m10.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: requests<3,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from wandb) (2.31.0)\n", - "Requirement already satisfied: psutil>=5.0.0 in /usr/local/lib/python3.10/dist-packages (from wandb) (5.9.5)\n", - "Collecting sentry-sdk>=1.0.0 (from wandb)\n", - " Downloading sentry_sdk-1.30.0-py2.py3-none-any.whl (218 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m218.8/218.8 kB\u001b[0m \u001b[31m12.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting docker-pycreds>=0.4.0 (from wandb)\n", - " Downloading docker_pycreds-0.4.0-py2.py3-none-any.whl (9.0 kB)\n", - "Requirement already satisfied: PyYAML in /usr/local/lib/python3.10/dist-packages (from wandb) (6.0.1)\n", - "Collecting pathtools (from wandb)\n", - " Downloading pathtools-0.1.2.tar.gz (11 kB)\n", - " Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", - "Collecting setproctitle (from wandb)\n", - " Downloading setproctitle-1.3.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30 kB)\n", - "Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (from wandb) (67.7.2)\n", - "Requirement already satisfied: appdirs>=1.4.3 in /usr/local/lib/python3.10/dist-packages (from wandb) (1.4.4)\n", - "Requirement already satisfied: protobuf!=4.21.0,<5,>=3.19.0 in /usr/local/lib/python3.10/dist-packages (from wandb) (3.20.3)\n", - "Requirement already satisfied: six>=1.4.0 in /usr/local/lib/python3.10/dist-packages (from docker-pycreds>=0.4.0->wandb) (1.16.0)\n", - "Collecting gitdb<5,>=4.0.1 (from GitPython!=3.1.29,>=1.0.0->wandb)\n", - " Downloading gitdb-4.0.10-py3-none-any.whl (62 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.7/62.7 kB\u001b[0m \u001b[31m5.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.0.0->wandb) (3.2.0)\n", - "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.0.0->wandb) (3.4)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.0.0->wandb) (2.0.4)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.0.0->wandb) (2023.7.22)\n", - "Collecting smmap<6,>=3.0.1 (from gitdb<5,>=4.0.1->GitPython!=3.1.29,>=1.0.0->wandb)\n", - " Downloading smmap-5.0.0-py3-none-any.whl (24 kB)\n", - "Building wheels for collected packages: pathtools\n", - " Building wheel for pathtools (setup.py) ... \u001b[?25l\u001b[?25hdone\n", - " Created wheel for pathtools: filename=pathtools-0.1.2-py3-none-any.whl size=8791 sha256=ff575a2fd914e2e273ee50aa4b9d3b4ec0cb00b32c1911f361d81a3115469392\n", - " Stored in directory: /root/.cache/pip/wheels/e7/f3/22/152153d6eb222ee7a56ff8617d80ee5207207a8c00a7aab794\n", - "Successfully built pathtools\n", - "Installing collected packages: pathtools, smmap, setproctitle, sentry-sdk, docker-pycreds, gitdb, GitPython, wandb\n", - "Successfully installed GitPython-3.1.32 docker-pycreds-0.4.0 gitdb-4.0.10 pathtools-0.1.2 sentry-sdk-1.30.0 setproctitle-1.3.2 smmap-5.0.0 wandb-0.15.9\n" - ] - } - ], - "source": [ - "try:\n", - " import wandb\n", - "except:\n", - " !pip install wandb\n", - " import wandb" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "MNb-170T_xCK", - "outputId": "3b425dc9-0d32-4c5a-adde-e9e8764a75b0" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[34m\u001b[1mwandb\u001b[0m: (1) Create a W&B account\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: (2) Use an existing W&B account\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: (3) Don't visualize my results\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Enter your choice: 2\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: You chose 'Use an existing W&B account'\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Logging into wandb.ai. (Learn how to deploy a W&B server locally: https://wandb.me/wandb-server)\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: You can find your API key in your browser here: https://wandb.ai/authorize\n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Paste an API key from your profile and hit enter, or press ctrl+c to quit: \n", - "\u001b[34m\u001b[1mwandb\u001b[0m: Appending key for api.wandb.ai to your netrc file: /root/.netrc\n", - "No new successful fine-tunes were found\n", - "🎉 wandb sync completed successfully\n" - ] - } - ], - "source": [ - "!openai wandb sync" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "k-MAI-1E2RJp" - }, - "source": [ - "# 1.Preparing the dataset" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "ll-77RgaeLUa" - }, - "source": [ - "## 1.1. Preparing the data in JSON" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "5Yn8Xe1ciRIV", - "outputId": "a1f830ab-5327-44aa-e664-90cfd58a9d04" - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[nltk_data] Downloading package punkt to /root/nltk_data...\n", - "[nltk_data] Package punkt is already up-to-date!\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - " % Total % Received % Xferd Average Speed Time Time Time Current\n", - " Dload Upload Total Spent Left Speed\n", - "\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 1295k 100 1295k 0 0 5208k 0 --:--:-- --:--:-- --:--:-- 5222k\n" - ] - } - ], - "source": [ - "#From Gutenberg to JSON\n", - "import nltk\n", - "nltk.download('punkt')\n", - "from nltk.tokenize import sent_tokenize\n", - "import requests\n", - "from bs4 import BeautifulSoup\n", - "import json\n", - "import re\n", - "\n", - "# First, fetch the text of the book\n", - "# Option 1: from Project Gutenberg\n", - "#url = 'http://www.gutenberg.org/cache/epub/4280/pg4280.html'\n", - "#response = requests.get(url)\n", - "#soup = BeautifulSoup(response.content, 'html.parser')\n", - "\n", - "# Option 2: from the GitHub repository:\n", - "#Development access to delete when going into production\n", - "!curl -L https://raw.githubusercontent.com/Denis2054/Transformers-for-NLP-2nd-Edition/master/Chapter07/gutenberg.org_cache_epub_4280_pg4280.html --output \"gutenberg.org_cache_epub_4280_pg4280.html\"\n", - "\n", - "# Open and read the downloaded HTML file\n", - "with open(\"gutenberg.org_cache_epub_4280_pg4280.html\", 'r', encoding='utf-8') as file:\n", - " file_contents = file.read()\n", - "\n", - "# Parse the file contents using BeautifulSoup\n", - "soup = BeautifulSoup(file_contents, 'html.parser')\n", - "\n", - "# Get the text of the book and clean it up a bit\n", - "text = soup.get_text()\n", - "text = re.sub('\\s+', ' ', text).strip()\n", - "\n", - "# Split the text into sentences\n", - "sentences = sent_tokenize(text)\n", - "\n", - "# Define the separator and ending\n", - "prompt_separator = \" ->\"\n", - "completion_ending = \"\\n\"\n", - "\n", - "# Now create the prompts and completions\n", - "data = []\n", - "for i in range(len(sentences) - 1):\n", - " data.append({\n", - " \"prompt\": sentences[i] + prompt_separator,\n", - " \"completion\": \" \" + sentences[i + 1] + completion_ending\n", - " })\n", - "\n", - "# Write the prompts and completions to a file\n", - "with open('kant_prompts_and_completions.json', 'w') as f:\n", - " for line in data:\n", - " f.write(json.dumps(line) + '\\n')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 424 - }, - "id": "ut59UvQ5e0ZX", - "outputId": "c911130f-9a36-48e0-fa49-1b77c98d6b75" - }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "
\n", - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
promptcompletion
0The Project Gutenberg Etext of The Critique of...Be sure to check the copyright laws for your ...
1Be sure to check the copyright laws for your c...We encourage you to keep this file, exactly a...
2We encourage you to keep this file, exactly as...Please do not remove this.\\n
3Please do not remove this. ->This header should be the first thing seen wh...
4This header should be the first thing seen whe...Do not change or edit it without written perm...
.........
612278-79. is their motto, under which they may le...As regards those who wish to pursue a scienti...
6123As regards those who wish to pursue a scientif...When I mention, in relation to the former, th...
6124When I mention, in relation to the former, the...The critical path alone is still open.\\n
6125The critical path alone is still open. ->If my reader has been kind and patient enough...
6126If my reader has been kind and patient enough ...End of Project Gutenberg's The Critique of Pu...
\n", - "

6127 rows × 2 columns

\n", - "
\n", - "
\n", - "\n", - "
\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "
\n", - "\n", - "\n", - "
\n", - " \n", - "\n", - "\n", - "\n", - " \n", - "
\n", - "
\n", - "
\n" - ], - "text/plain": [ - " prompt \\\n", - "0 The Project Gutenberg Etext of The Critique of... \n", - "1 Be sure to check the copyright laws for your c... \n", - "2 We encourage you to keep this file, exactly as... \n", - "3 Please do not remove this. -> \n", - "4 This header should be the first thing seen whe... \n", - "... ... \n", - "6122 78-79. is their motto, under which they may le... \n", - "6123 As regards those who wish to pursue a scientif... \n", - "6124 When I mention, in relation to the former, the... \n", - "6125 The critical path alone is still open. -> \n", - "6126 If my reader has been kind and patient enough ... \n", - "\n", - " completion \n", - "0 Be sure to check the copyright laws for your ... \n", - "1 We encourage you to keep this file, exactly a... \n", - "2 Please do not remove this.\\n \n", - "3 This header should be the first thing seen wh... \n", - "4 Do not change or edit it without written perm... \n", - "... ... \n", - "6122 As regards those who wish to pursue a scienti... \n", - "6123 When I mention, in relation to the former, th... \n", - "6124 The critical path alone is still open.\\n \n", - "6125 If my reader has been kind and patient enough... \n", - "6126 End of Project Gutenberg's The Critique of Pu... \n", - "\n", - "[6127 rows x 2 columns]" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import pandas as pd\n", - "\n", - "# Load the data\n", - "df = pd.read_json('kant_prompts_and_completions.json', lines=True)\n", - "df" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "rC5FIgJ37uKB" - }, - "source": [ - "## 1.2. Converting the data to JSONL\n", - "\n", - "Answer the questions as necessary for your project." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "A8ZoW1Dn5u7x", - "outputId": "65a3b06d-a74a-4116-899d-30cb8a39e618" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Analyzing...\n", - "\n", - "- Your JSON file appears to be in a JSONL format. Your file will be converted to JSONL format\n", - "- Your file contains 6127 prompt-completion pairs\n", - "- All prompts end with suffix ` ->`\n", - "- All completions end with suffix `\\n`\n", - "\n", - "Based on the analysis we will perform the following actions:\n", - "- [Necessary] Your format `JSON` will be converted to `JSONL`\n", - "\n", - "\n", - "Your data will be written to a new JSONL file. Proceed [Y/n]: Y\n", - "\n", - "Wrote modified file to `kant_prompts_and_completions_prepared.jsonl`\n", - "Feel free to take a look!\n", - "\n", - "Now use that file when fine-tuning:\n", - "> openai api fine_tunes.create -t \"kant_prompts_and_completions_prepared.jsonl\"\n", - "\n", - "After you’ve fine-tuned a model, remember that your prompt has to end with the indicator string ` ->` for the model to start generating completions, rather than continuing with the prompt. Make sure to include `stop=[\"\\n\"]` so that the generated texts ends at the expected place.\n", - "Once your model starts training, it'll approximately take 1.44 hours to train a `curie` model, and less for `ada` and `babbage`. Queue will approximately take half an hour per job ahead of you.\n" - ] - } - ], - "source": [ - "!openai tools fine_tunes.prepare_data -f \"kant_prompts_and_completions.json\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "nf30vW4Wizop", - "outputId": "0e59ab1b-3f35-4ff0-c911-04ff5ad44400" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " \"prompt\": \"For he found that it was not sufficient to meditate on the figure, as it lay before his eyes, or the conception of it, as it existed in his mind, and thus endeavour to get at the knowledge of its properties, but that it was necessary to produce these properties, as it were, by a positive a priori construction; and that, in order to arrive with certainty at a priori cognition, he must not attribute to the object any other properties than those which necessarily followed from that which he had himself, in accordance with his conception, placed in the object. ->\",\n", - " \"completion\": \" A much longer period elapsed before physics entered on the highway of science.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"A much longer period elapsed before physics entered on the highway of science. ->\",\n", - " \"completion\": \" For it is only about a century and a half since the wise Bacon gave a new direction to physical studies, or rather\\u2014as others were already on the right track\\u2014imparted fresh vigour to the pursuit of this new direction.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For it is only about a century and a half since the wise Bacon gave a new direction to physical studies, or rather\\u2014as others were already on the right track\\u2014imparted fresh vigour to the pursuit of this new direction. ->\",\n", - " \"completion\": \" Here, too, as in the case of mathematics, we find evidence of a rapid intellectual revolution.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Here, too, as in the case of mathematics, we find evidence of a rapid intellectual revolution. ->\",\n", - " \"completion\": \" In the remarks which follow I shall confine myself to the empirical side of natural science.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"In the remarks which follow I shall confine myself to the empirical side of natural science. ->\",\n", - " \"completion\": \" When Galilei experimented with balls of a definite weight on the inclined plane, when Torricelli caused the air to sustain a weight which he had calculated beforehand to be equal to that of a definite column of water, or when Stahl, at a later period, converted metals into lime, and reconverted lime into metal, by the addition and subtraction of certain elements; [Footnote: I do not here follow with exactness the history of the experimental method, of which, indeed, the first steps are involved in some obscurity.]\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"When Galilei experimented with balls of a definite weight on the inclined plane, when Torricelli caused the air to sustain a weight which he had calculated beforehand to be equal to that of a definite column of water, or when Stahl, at a later period, converted metals into lime, and reconverted lime into metal, by the addition and subtraction of certain elements; [Footnote: I do not here follow with exactness the history of the experimental method, of which, indeed, the first steps are involved in some obscurity.] ->\",\n", - " \"completion\": \" a light broke upon all natural philosophers.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"a light broke upon all natural philosophers. ->\",\n", - " \"completion\": \" They learned that reason only perceives that which it produces after its own design; that it must not be content to follow, as it were, in the leading-strings of nature, but must proceed in advance with principles of judgement according to unvarying laws, and compel nature to reply its questions.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"They learned that reason only perceives that which it produces after its own design; that it must not be content to follow, as it were, in the leading-strings of nature, but must proceed in advance with principles of judgement according to unvarying laws, and compel nature to reply its questions. ->\",\n", - " \"completion\": \" For accidental observations, made according to no preconceived plan, cannot be united under a necessary law.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For accidental observations, made according to no preconceived plan, cannot be united under a necessary law. ->\",\n", - " \"completion\": \" But it is this that reason seeks for and requires.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But it is this that reason seeks for and requires. ->\",\n", - " \"completion\": \" It is only the principles of reason which can give to concordant phenomena the validity of laws, and it is only when experiment is directed by these rational principles that it can have any real utility.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"It is only the principles of reason which can give to concordant phenomena the validity of laws, and it is only when experiment is directed by these rational principles that it can have any real utility. ->\",\n", - " \"completion\": \" Reason must approach nature with the view, indeed, of receiving information from it, not, however, in the character of a pupil, who listens to all that his master chooses to tell him, but in that of a judge, who compels the witnesses to reply to those questions which he himself thinks fit to propose.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Reason must approach nature with the view, indeed, of receiving information from it, not, however, in the character of a pupil, who listens to all that his master chooses to tell him, but in that of a judge, who compels the witnesses to reply to those questions which he himself thinks fit to propose. ->\",\n", - " \"completion\": \" To this single idea must the revolution be ascribed, by which, after groping in the dark for so many centuries, natural science was at length conducted into the path of certain progress.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"To this single idea must the revolution be ascribed, by which, after groping in the dark for so many centuries, natural science was at length conducted into the path of certain progress. ->\",\n", - " \"completion\": \" We come now to metaphysics, a purely speculative science, which occupies a completely isolated position and is entirely independent of the teachings of experience.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"We come now to metaphysics, a purely speculative science, which occupies a completely isolated position and is entirely independent of the teachings of experience. ->\",\n", - " \"completion\": \" It deals with mere conceptions\\u2014not, like mathematics, with conceptions applied to intuition\\u2014and in it, reason is the pupil of itself alone.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"It deals with mere conceptions\\u2014not, like mathematics, with conceptions applied to intuition\\u2014and in it, reason is the pupil of itself alone. ->\",\n", - " \"completion\": \" It is the oldest of the sciences, and would still survive, even if all the rest were swallowed up in the abyss of an all-destroying barbarism.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"It is the oldest of the sciences, and would still survive, even if all the rest were swallowed up in the abyss of an all-destroying barbarism. ->\",\n", - " \"completion\": \" But it has not yet had the good fortune to attain to the sure scientific method.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But it has not yet had the good fortune to attain to the sure scientific method. ->\",\n", - " \"completion\": \" This will be apparent; if we apply the tests which we proposed at the outset.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"This will be apparent; if we apply the tests which we proposed at the outset. ->\",\n", - " \"completion\": \" We find that reason perpetually comes to a stand, when it attempts to gain a priori the perception even of those laws which the most common experience confirms.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"We find that reason perpetually comes to a stand, when it attempts to gain a priori the perception even of those laws which the most common experience confirms. ->\",\n", - " \"completion\": \" We find it compelled to retrace its steps in innumerable instances, and to abandon the path on which it had entered, because this does not lead to the desired result.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"We find it compelled to retrace its steps in innumerable instances, and to abandon the path on which it had entered, because this does not lead to the desired result. ->\",\n", - " \"completion\": \" We find, too, that those who are engaged in metaphysical pursuits are far from being able to agree among themselves, but that, on the contrary, this science appears to furnish an arena specially adapted for the display of skill or the exercise of strength in mock-contests\\u2014 a field in which no combatant ever yet succeeded in gaining an inch of ground, in which, at least, no victory was ever yet crowned with permanent possession.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"We find, too, that those who are engaged in metaphysical pursuits are far from being able to agree among themselves, but that, on the contrary, this science appears to furnish an arena specially adapted for the display of skill or the exercise of strength in mock-contests\\u2014 a field in which no combatant ever yet succeeded in gaining an inch of ground, in which, at least, no victory was ever yet crowned with permanent possession. ->\",\n", - " \"completion\": \" This leads us to inquire why it is that, in metaphysics, the sure path of science has not hitherto been found.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"This leads us to inquire why it is that, in metaphysics, the sure path of science has not hitherto been found. ->\",\n", - " \"completion\": \" Shall we suppose that it is impossible to discover it?\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Shall we suppose that it is impossible to discover it? ->\",\n", - " \"completion\": \" Why then should nature have visited our reason with restless aspirations after it, as if it were one of our weightiest concerns?\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Why then should nature have visited our reason with restless aspirations after it, as if it were one of our weightiest concerns? ->\",\n", - " \"completion\": \" Nay, more, how little cause should we have to place confidence in our reason, if it abandons us in a matter about which, most of all, we desire to know the truth\\u2014and not only so, but even allures us to the pursuit of vain phantoms, only to betray us in the end?\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Nay, more, how little cause should we have to place confidence in our reason, if it abandons us in a matter about which, most of all, we desire to know the truth\\u2014and not only so, but even allures us to the pursuit of vain phantoms, only to betray us in the end? ->\",\n", - " \"completion\": \" Or, if the path has only hitherto been missed, what indications do we possess to guide us in a renewed investigation, and to enable us to hope for greater success than has fallen to the lot of our predecessors?\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Or, if the path has only hitherto been missed, what indications do we possess to guide us in a renewed investigation, and to enable us to hope for greater success than has fallen to the lot of our predecessors? ->\",\n", - " \"completion\": \" It appears to me that the examples of mathematics and natural philosophy, which, as we have seen, were brought into their present condition by a sudden revolution, are sufficiently remarkable to fix our attention on the essential circumstances of the change which has proved so advantageous to them, and to induce us to make the experiment of imitating them, so far as the analogy which, as rational sciences, they bear to metaphysics may permit.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"It appears to me that the examples of mathematics and natural philosophy, which, as we have seen, were brought into their present condition by a sudden revolution, are sufficiently remarkable to fix our attention on the essential circumstances of the change which has proved so advantageous to them, and to induce us to make the experiment of imitating them, so far as the analogy which, as rational sciences, they bear to metaphysics may permit. ->\",\n", - " \"completion\": \" It has hitherto been assumed that our cognition must conform to the objects; but all attempts to ascertain anything about these objects a priori, by means of conceptions, and thus to extend the range of our knowledge, have been rendered abortive by this assumption.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"It has hitherto been assumed that our cognition must conform to the objects; but all attempts to ascertain anything about these objects a priori, by means of conceptions, and thus to extend the range of our knowledge, have been rendered abortive by this assumption. ->\",\n", - " \"completion\": \" Let us then make the experiment whether we may not be more successful in metaphysics, if we assume that the objects must conform to our cognition.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Let us then make the experiment whether we may not be more successful in metaphysics, if we assume that the objects must conform to our cognition. ->\",\n", - " \"completion\": \" This appears, at all events, to accord better with the possibility of our gaining the end we have in view, that is to say, of arriving at the cognition of objects a priori, of determining something with respect to these objects, before they are given to us.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"This appears, at all events, to accord better with the possibility of our gaining the end we have in view, that is to say, of arriving at the cognition of objects a priori, of determining something with respect to these objects, before they are given to us. ->\",\n", - " \"completion\": \" We here propose to do just what Copernicus did in attempting to explain the celestial movements.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"We here propose to do just what Copernicus did in attempting to explain the celestial movements. ->\",\n", - " \"completion\": \" When he found that he could make no progress by assuming that all the heavenly bodies revolved round the spectator, he reversed the process, and tried the experiment of assuming that the spectator revolved, while the stars remained at rest.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"When he found that he could make no progress by assuming that all the heavenly bodies revolved round the spectator, he reversed the process, and tried the experiment of assuming that the spectator revolved, while the stars remained at rest. ->\",\n", - " \"completion\": \" We may make the same experiment with regard to the intuition of objects.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"We may make the same experiment with regard to the intuition of objects. ->\",\n", - " \"completion\": \" If the intuition must conform to the nature of the objects, I do not see how we can know anything of them a priori.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"If the intuition must conform to the nature of the objects, I do not see how we can know anything of them a priori. ->\",\n", - " \"completion\": \" If, on the other hand, the object conforms to the nature of our faculty of intuition, I can then easily conceive the possibility of such an a priori knowledge.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"If, on the other hand, the object conforms to the nature of our faculty of intuition, I can then easily conceive the possibility of such an a priori knowledge. ->\",\n", - " \"completion\": \" Now as I cannot rest in the mere intuitions, but\\u2014if they are to become cognitions\\u2014must refer them, as representations, to something, as object, and must determine the latter by means of the former, here again there are two courses open to me.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Now as I cannot rest in the mere intuitions, but\\u2014if they are to become cognitions\\u2014must refer them, as representations, to something, as object, and must determine the latter by means of the former, here again there are two courses open to me. ->\",\n", - " \"completion\": \" Either, first, I may assume that the conceptions, by which I effect this determination, conform to the object\\u2014and in this case I am reduced to the same perplexity as before; or secondly, I may assume that the objects, or, which is the same thing, that experience, in which alone as given objects they are cognized, conform to my conceptions\\u2014and then I am at no loss how to proceed.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Either, first, I may assume that the conceptions, by which I effect this determination, conform to the object\\u2014and in this case I am reduced to the same perplexity as before; or secondly, I may assume that the objects, or, which is the same thing, that experience, in which alone as given objects they are cognized, conform to my conceptions\\u2014and then I am at no loss how to proceed. ->\",\n", - " \"completion\": \" For experience itself is a mode of cognition which requires understanding.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For experience itself is a mode of cognition which requires understanding. ->\",\n", - " \"completion\": \" Before objects, are given to me, that is, a priori, I must presuppose in myself laws of the understanding which are expressed in conceptions a priori.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Before objects, are given to me, that is, a priori, I must presuppose in myself laws of the understanding which are expressed in conceptions a priori. ->\",\n", - " \"completion\": \" To these conceptions, then, all the objects of experience must necessarily conform.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"To these conceptions, then, all the objects of experience must necessarily conform. ->\",\n", - " \"completion\": \" Now there are objects which reason thinks, and that necessarily, but which cannot be given in experience, or, at least, cannot be given so as reason thinks them.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Now there are objects which reason thinks, and that necessarily, but which cannot be given in experience, or, at least, cannot be given so as reason thinks them. ->\",\n", - " \"completion\": \" The attempt to think these objects will hereafter furnish an excellent test of the new method of thought which we have adopted, and which is based on the principle that we only cognize in things a priori that which we ourselves place in them.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"The attempt to think these objects will hereafter furnish an excellent test of the new method of thought which we have adopted, and which is based on the principle that we only cognize in things a priori that which we ourselves place in them. ->\",\n", - " \"completion\": \" * [*Footnote: This method, accordingly, which we have borrowed from the natural philosopher, consists in seeking for the elements of pure reason in that which admits of confirmation or refutation by experiment.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"* [*Footnote: This method, accordingly, which we have borrowed from the natural philosopher, consists in seeking for the elements of pure reason in that which admits of confirmation or refutation by experiment. ->\",\n", - " \"completion\": \" Now the propositions of pure reason, especially when they transcend the limits of possible experience, do not admit of our making any experiment with their objects, as in natural science.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Now the propositions of pure reason, especially when they transcend the limits of possible experience, do not admit of our making any experiment with their objects, as in natural science. ->\",\n", - " \"completion\": \" Hence, with regard to those conceptions and principles which we assume a priori, our only course ill be to view them from two different sides.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Hence, with regard to those conceptions and principles which we assume a priori, our only course ill be to view them from two different sides. ->\",\n", - " \"completion\": \" We must regard one and the same conception, on the one hand, in relation to experience as an object of the senses and of the understanding, on the other hand, in relation to reason, isolated and transcending the limits of experience, as an object of mere thought.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"We must regard one and the same conception, on the one hand, in relation to experience as an object of the senses and of the understanding, on the other hand, in relation to reason, isolated and transcending the limits of experience, as an object of mere thought. ->\",\n", - " \"completion\": \" Now if we find that, when we regard things from this double point of view, the result is in harmony with the principle of pure reason, but that, when we regard them from a single point of view, reason is involved in self-contradiction, then the experiment will establish the correctness of this distinction.]\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Now if we find that, when we regard things from this double point of view, the result is in harmony with the principle of pure reason, but that, when we regard them from a single point of view, reason is involved in self-contradiction, then the experiment will establish the correctness of this distinction.] ->\",\n", - " \"completion\": \" This attempt succeeds as well as we could desire, and promises to metaphysics, in its first part\\u2014that is, where it is occupied with conceptions a priori, of which the corresponding objects may be given in experience\\u2014the certain course of science.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"This attempt succeeds as well as we could desire, and promises to metaphysics, in its first part\\u2014that is, where it is occupied with conceptions a priori, of which the corresponding objects may be given in experience\\u2014the certain course of science. ->\",\n", - " \"completion\": \" For by this new method we are enabled perfectly to explain the possibility of a priori cognition, and, what is more, to demonstrate satisfactorily the laws which lie a priori at the foundation of nature, as the sum of the objects of experience\\u2014neither of which was possible according to the procedure hitherto followed.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For by this new method we are enabled perfectly to explain the possibility of a priori cognition, and, what is more, to demonstrate satisfactorily the laws which lie a priori at the foundation of nature, as the sum of the objects of experience\\u2014neither of which was possible according to the procedure hitherto followed. ->\",\n", - " \"completion\": \" But from this deduction of the faculty of a priori cognition in the first part of metaphysics, we derive a surprising result, and one which, to all appearance, militates against the great end of metaphysics, as treated in the second part.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But from this deduction of the faculty of a priori cognition in the first part of metaphysics, we derive a surprising result, and one which, to all appearance, militates against the great end of metaphysics, as treated in the second part. ->\",\n", - " \"completion\": \" For we come to the conclusion that our faculty of cognition is unable to transcend the limits of possible experience; and yet this is precisely the most essential object of this science.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For we come to the conclusion that our faculty of cognition is unable to transcend the limits of possible experience; and yet this is precisely the most essential object of this science. ->\",\n", - " \"completion\": \" The estimate of our rational cognition a priori at which we arrive is that it has only to do with phenomena, and that things in themselves, while possessing a real existence, lie beyond its sphere.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"The estimate of our rational cognition a priori at which we arrive is that it has only to do with phenomena, and that things in themselves, while possessing a real existence, lie beyond its sphere. ->\",\n", - " \"completion\": \" Here we are enabled to put the justice of this estimate to the test.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Here we are enabled to put the justice of this estimate to the test. ->\",\n", - " \"completion\": \" For that which of necessity impels us to transcend the limits of experience and of all phenomena is the unconditioned, which reason absolutely requires in things as they are in themselves, in order to complete the series of conditions.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For that which of necessity impels us to transcend the limits of experience and of all phenomena is the unconditioned, which reason absolutely requires in things as they are in themselves, in order to complete the series of conditions. ->\",\n", - " \"completion\": \" Now, if it appears that when, on the one hand, we assume that our cognition conforms to its objects as things in themselves, the unconditioned cannot be thought without contradiction, and that when, on the other hand, we assume that our representation of things as they are given to us, does not conform to these things as they are in themselves, but that these objects, as phenomena, conform to our mode of representation, the contradiction disappears: we shall then be convinced of the truth of that which we began by assuming for the sake of experiment; we may look upon it as established that the unconditioned does not lie in things as we know them, or as they are given to us, but in things as they are in themselves, beyond the range of our cognition.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Now, if it appears that when, on the one hand, we assume that our cognition conforms to its objects as things in themselves, the unconditioned cannot be thought without contradiction, and that when, on the other hand, we assume that our representation of things as they are given to us, does not conform to these things as they are in themselves, but that these objects, as phenomena, conform to our mode of representation, the contradiction disappears: we shall then be convinced of the truth of that which we began by assuming for the sake of experiment; we may look upon it as established that the unconditioned does not lie in things as we know them, or as they are given to us, but in things as they are in themselves, beyond the range of our cognition. ->\",\n", - " \"completion\": \" * [*Footnote: This experiment of pure reason has a great similarity to that of the chemists, which they term the experiment of reduction, or, more usually, the synthetic process.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"* [*Footnote: This experiment of pure reason has a great similarity to that of the chemists, which they term the experiment of reduction, or, more usually, the synthetic process. ->\",\n", - " \"completion\": \" The analysis of the metaphysician separates pure cognition a priori into two heterogeneous elements, viz., the cognition of things as phenomena, and of things in themselves.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"The analysis of the metaphysician separates pure cognition a priori into two heterogeneous elements, viz., the cognition of things as phenomena, and of things in themselves. ->\",\n", - " \"completion\": \" Dialectic combines these again into harmony with the necessary rational idea of the unconditioned, and finds that this harmony never results except through the above distinction, which is, therefore, concluded to be just.]\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Dialectic combines these again into harmony with the necessary rational idea of the unconditioned, and finds that this harmony never results except through the above distinction, which is, therefore, concluded to be just.] ->\",\n", - " \"completion\": \" But, after we have thus denied the power of speculative reason to make any progress in the sphere of the supersensible, it still remains for our consideration whether data do not exist in practical cognition which may enable us to determine the transcendent conception of the unconditioned, to rise beyond the limits of all possible experience from a practical point of view, and thus to satisfy the great ends of metaphysics.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But, after we have thus denied the power of speculative reason to make any progress in the sphere of the supersensible, it still remains for our consideration whether data do not exist in practical cognition which may enable us to determine the transcendent conception of the unconditioned, to rise beyond the limits of all possible experience from a practical point of view, and thus to satisfy the great ends of metaphysics. ->\",\n", - " \"completion\": \" Speculative reason has thus, at least, made room for such an extension of our knowledge: and, if it must leave this space vacant, still it does not rob us of the liberty to fill it up, if we can, by means of practical data\\u2014nay, it even challenges us to make the attempt.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Speculative reason has thus, at least, made room for such an extension of our knowledge: and, if it must leave this space vacant, still it does not rob us of the liberty to fill it up, if we can, by means of practical data\\u2014nay, it even challenges us to make the attempt. ->\",\n", - " \"completion\": \" * [*Footnote: So the central laws of the movements of the heavenly bodies established the truth of that which Copernicus, first, assumed only as a hypothesis, and, at the same time, brought to light that invisible force (Newtonian attraction) which holds the universe together.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"* [*Footnote: So the central laws of the movements of the heavenly bodies established the truth of that which Copernicus, first, assumed only as a hypothesis, and, at the same time, brought to light that invisible force (Newtonian attraction) which holds the universe together. ->\",\n", - " \"completion\": \" The latter would have remained forever undiscovered, if Copernicus had not ventured on the experiment\\u2014contrary to the senses but still just\\u2014 of looking for the observed movements not in the heavenly bodies, but in the spectator.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"The latter would have remained forever undiscovered, if Copernicus had not ventured on the experiment\\u2014contrary to the senses but still just\\u2014 of looking for the observed movements not in the heavenly bodies, but in the spectator. ->\",\n", - " \"completion\": \" In this Preface I treat the new metaphysical method as a hypothesis with the view of rendering apparent the first attempts at such a change of method, which are always hypothetical.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"In this Preface I treat the new metaphysical method as a hypothesis with the view of rendering apparent the first attempts at such a change of method, which are always hypothetical. ->\",\n", - " \"completion\": \" But in the Critique itself it will be demonstrated, not hypothetically, but apodeictically, from the nature of our representations of space and time, and from the elementary conceptions of the understanding.]\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But in the Critique itself it will be demonstrated, not hypothetically, but apodeictically, from the nature of our representations of space and time, and from the elementary conceptions of the understanding.] ->\",\n", - " \"completion\": \" This attempt to introduce a complete revolution in the procedure of metaphysics, after the example of the geometricians and natural philosophers, constitutes the aim of the Critique of Pure Speculative Reason.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"This attempt to introduce a complete revolution in the procedure of metaphysics, after the example of the geometricians and natural philosophers, constitutes the aim of the Critique of Pure Speculative Reason. ->\",\n", - " \"completion\": \" It is a treatise on the method to be followed, not a system of the science itself.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"It is a treatise on the method to be followed, not a system of the science itself. ->\",\n", - " \"completion\": \" But, at the same time, it marks out and defines both the external boundaries and the internal structure of this science.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But, at the same time, it marks out and defines both the external boundaries and the internal structure of this science. ->\",\n", - " \"completion\": \" For pure speculative reason has this peculiarity, that, in choosing the various objects of thought, it is able to define the limits of its own faculties, and even to give a complete enumeration of the possible modes of proposing problems to itself, and thus to sketch out the entire system of metaphysics.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For pure speculative reason has this peculiarity, that, in choosing the various objects of thought, it is able to define the limits of its own faculties, and even to give a complete enumeration of the possible modes of proposing problems to itself, and thus to sketch out the entire system of metaphysics. ->\",\n", - " \"completion\": \" For, on the one hand, in cognition a priori, nothing must be attributed to the objects but what the thinking subject derives from itself; and, on the other hand, reason is, in regard to the principles of cognition, a perfectly distinct, independent unity, in which, as in an organized body, every member exists for the sake of the others, and all for the sake of each, so that no principle can be viewed, with safety, in one relationship, unless it is, at the same time, viewed in relation to the total use of pure reason.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For, on the one hand, in cognition a priori, nothing must be attributed to the objects but what the thinking subject derives from itself; and, on the other hand, reason is, in regard to the principles of cognition, a perfectly distinct, independent unity, in which, as in an organized body, every member exists for the sake of the others, and all for the sake of each, so that no principle can be viewed, with safety, in one relationship, unless it is, at the same time, viewed in relation to the total use of pure reason. ->\",\n", - " \"completion\": \" Hence, too, metaphysics has this singular advantage\\u2014an advantage which falls to the lot of no other science which has to do with objects\\u2014that, if once it is conducted into the sure path of science, by means of this criticism, it can then take in the whole sphere of its cognitions, and can thus complete its work, and leave it for the use of posterity, as a capital which can never receive fresh accessions.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Hence, too, metaphysics has this singular advantage\\u2014an advantage which falls to the lot of no other science which has to do with objects\\u2014that, if once it is conducted into the sure path of science, by means of this criticism, it can then take in the whole sphere of its cognitions, and can thus complete its work, and leave it for the use of posterity, as a capital which can never receive fresh accessions. ->\",\n", - " \"completion\": \" For metaphysics has to deal only with principles and with the limitations of its own employment as determined by these principles.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For metaphysics has to deal only with principles and with the limitations of its own employment as determined by these principles. ->\",\n", - " \"completion\": \" To this perfection it is, therefore, bound, as the fundamental science, to attain, and to it the maxim may justly be applied: Nil actum reputans, si quid superesset agendum.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"To this perfection it is, therefore, bound, as the fundamental science, to attain, and to it the maxim may justly be applied: Nil actum reputans, si quid superesset agendum. ->\",\n", - " \"completion\": \" But, it will be asked, what kind of a treasure is this that we propose to bequeath to posterity?\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But, it will be asked, what kind of a treasure is this that we propose to bequeath to posterity? ->\",\n", - " \"completion\": \" What is the real value of this system of metaphysics, purified by criticism, and thereby reduced to a permanent condition?\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"What is the real value of this system of metaphysics, purified by criticism, and thereby reduced to a permanent condition? ->\",\n", - " \"completion\": \" A cursory view of the present work will lead to the supposition that its use is merely negative, that it only serves to warn us against venturing, with speculative reason, beyond the limits of experience.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"A cursory view of the present work will lead to the supposition that its use is merely negative, that it only serves to warn us against venturing, with speculative reason, beyond the limits of experience. ->\",\n", - " \"completion\": \" This is, in fact, its primary use.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"This is, in fact, its primary use. ->\",\n", - " \"completion\": \" But this, at once, assumes a positive value, when we observe that the principles with which speculative reason endeavours to transcend its limits lead inevitably, not to the extension, but to the contraction of the use of reason, inasmuch as they threaten to extend the limits of sensibility, which is their proper sphere, over the entire realm of thought and, thus, to supplant the pure (practical) use of reason.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But this, at once, assumes a positive value, when we observe that the principles with which speculative reason endeavours to transcend its limits lead inevitably, not to the extension, but to the contraction of the use of reason, inasmuch as they threaten to extend the limits of sensibility, which is their proper sphere, over the entire realm of thought and, thus, to supplant the pure (practical) use of reason. ->\",\n", - " \"completion\": \" So far, then, as this criticism is occupied in confining speculative reason within its proper bounds, it is only negative; but, inasmuch as it thereby, at the same time, removes an obstacle which impedes and even threatens to destroy the use of practical reason, it possesses a positive and very important value.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"So far, then, as this criticism is occupied in confining speculative reason within its proper bounds, it is only negative; but, inasmuch as it thereby, at the same time, removes an obstacle which impedes and even threatens to destroy the use of practical reason, it possesses a positive and very important value. ->\",\n", - " \"completion\": \" In order to admit this, we have only to be convinced that there is an absolutely necessary use of pure reason\\u2014the moral use\\u2014in which it inevitably transcends the limits of sensibility, without the aid of speculation, requiring only to be insured against the effects of a speculation which would involve it in contradiction with itself.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"In order to admit this, we have only to be convinced that there is an absolutely necessary use of pure reason\\u2014the moral use\\u2014in which it inevitably transcends the limits of sensibility, without the aid of speculation, requiring only to be insured against the effects of a speculation which would involve it in contradiction with itself. ->\",\n", - " \"completion\": \" To deny the positive advantage of the service which this criticism renders us would be as absurd as to maintain that the system of police is productive of no positive benefit, since its main business is to prevent the violence which citizen has to apprehend from citizen, that so each may pursue his vocation in peace and security.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"To deny the positive advantage of the service which this criticism renders us would be as absurd as to maintain that the system of police is productive of no positive benefit, since its main business is to prevent the violence which citizen has to apprehend from citizen, that so each may pursue his vocation in peace and security. ->\",\n", - " \"completion\": \" That space and time are only forms of sensible intuition, and hence are only conditions of the existence of things as phenomena; that, moreover, we have no conceptions of the understanding, and, consequently, no elements for the cognition of things, except in so far as a corresponding intuition can be given to these conceptions; that, accordingly, we can have no cognition of an object, as a thing in itself, but only as an object of sensible intuition, that is, as phenomenon\\u2014all this is proved in the analytical part of the Critique; and from this the limitation of all possible speculative cognition to the mere objects of experience, follows as a necessary result.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"That space and time are only forms of sensible intuition, and hence are only conditions of the existence of things as phenomena; that, moreover, we have no conceptions of the understanding, and, consequently, no elements for the cognition of things, except in so far as a corresponding intuition can be given to these conceptions; that, accordingly, we can have no cognition of an object, as a thing in itself, but only as an object of sensible intuition, that is, as phenomenon\\u2014all this is proved in the analytical part of the Critique; and from this the limitation of all possible speculative cognition to the mere objects of experience, follows as a necessary result. ->\",\n", - " \"completion\": \" At the same time, it must be carefully borne in mind that, while we surrender the power of cognizing, we still reserve the power of thinking objects, as things in themselves.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"At the same time, it must be carefully borne in mind that, while we surrender the power of cognizing, we still reserve the power of thinking objects, as things in themselves. ->\",\n", - " \"completion\": \" * For, otherwise, we should require to affirm the existence of an appearance, without something that appears\\u2014which would be absurd.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"* For, otherwise, we should require to affirm the existence of an appearance, without something that appears\\u2014which would be absurd. ->\",\n", - " \"completion\": \" Now let us suppose, for a moment, that we had not undertaken this criticism and, accordingly, had not drawn the necessary distinction between things as objects of experience and things as they are in themselves.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Now let us suppose, for a moment, that we had not undertaken this criticism and, accordingly, had not drawn the necessary distinction between things as objects of experience and things as they are in themselves. ->\",\n", - " \"completion\": \" The principle of causality, and, by consequence, the mechanism of nature as determined by causality, would then have absolute validity in relation to all things as efficient causes.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"The principle of causality, and, by consequence, the mechanism of nature as determined by causality, would then have absolute validity in relation to all things as efficient causes. ->\",\n", - " \"completion\": \" I should then be unable to assert, with regard to one and the same being, e.g., the human soul, that its will is free, and yet, at the same time, subject to natural necessity, that is, not free, without falling into a palpable contradiction, for in both propositions I should take the soul in the same signification, as a thing in general, as a thing in itself\\u2014as, without previous criticism, I could not but take it.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"I should then be unable to assert, with regard to one and the same being, e.g., the human soul, that its will is free, and yet, at the same time, subject to natural necessity, that is, not free, without falling into a palpable contradiction, for in both propositions I should take the soul in the same signification, as a thing in general, as a thing in itself\\u2014as, without previous criticism, I could not but take it. ->\",\n", - " \"completion\": \" Suppose now, on the other hand, that we have undertaken this criticism, and have learnt that an object may be taken in two senses, first, as a phenomenon, secondly, as a thing in itself; and that, according to the deduction of the conceptions of the understanding, the principle of causality has reference only to things in the first sense.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Suppose now, on the other hand, that we have undertaken this criticism, and have learnt that an object may be taken in two senses, first, as a phenomenon, secondly, as a thing in itself; and that, according to the deduction of the conceptions of the understanding, the principle of causality has reference only to things in the first sense. ->\",\n", - " \"completion\": \" We then see how it does not involve any contradiction to assert, on the one hand, that the will, in the phenomenal sphere\\u2014in visible action\\u2014is necessarily obedient to the law of nature, and, in so far, not free; and, on the other hand, that, as belonging to a thing in itself, it is not subject to that law, and, accordingly, is free.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"We then see how it does not involve any contradiction to assert, on the one hand, that the will, in the phenomenal sphere\\u2014in visible action\\u2014is necessarily obedient to the law of nature, and, in so far, not free; and, on the other hand, that, as belonging to a thing in itself, it is not subject to that law, and, accordingly, is free. ->\",\n", - " \"completion\": \" Now, it is true that I cannot, by means of speculative reason, and still less by empirical observation, cognize my soul as a thing in itself and consequently, cannot cognize liberty as the property of a being to which I ascribe effects in the world of sense.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Now, it is true that I cannot, by means of speculative reason, and still less by empirical observation, cognize my soul as a thing in itself and consequently, cannot cognize liberty as the property of a being to which I ascribe effects in the world of sense. ->\",\n", - " \"completion\": \" For, to do so, I must cognize this being as existing, and yet not in time, which\\u2014since I cannot support my conception by any intuition\\u2014is impossible.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For, to do so, I must cognize this being as existing, and yet not in time, which\\u2014since I cannot support my conception by any intuition\\u2014is impossible. ->\",\n", - " \"completion\": \" At the same time, while I cannot cognize, I can quite well think freedom, that is to say, my representation of it involves at least no contradiction, if we bear in mind the critical distinction of the two modes of representation (the sensible and the intellectual) and the consequent limitation of the conceptions of the pure understanding and of the principles which flow from them.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"At the same time, while I cannot cognize, I can quite well think freedom, that is to say, my representation of it involves at least no contradiction, if we bear in mind the critical distinction of the two modes of representation (the sensible and the intellectual) and the consequent limitation of the conceptions of the pure understanding and of the principles which flow from them. ->\",\n", - " \"completion\": \" Suppose now that morality necessarily presupposed liberty, in the strictest sense, as a property of our will; suppose that reason contained certain practical, original principles a priori, which were absolutely impossible without this presupposition; and suppose, at the same time, that speculative reason had proved that liberty was incapable of being thought at all.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Suppose now that morality necessarily presupposed liberty, in the strictest sense, as a property of our will; suppose that reason contained certain practical, original principles a priori, which were absolutely impossible without this presupposition; and suppose, at the same time, that speculative reason had proved that liberty was incapable of being thought at all. ->\",\n", - " \"completion\": \" It would then follow that the moral presupposition must give way to the speculative affirmation, the opposite of which involves an obvious contradiction, and that liberty and, with it, morality must yield to the mechanism of nature; for the negation of morality involves no contradiction, except on the presupposition of liberty.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"It would then follow that the moral presupposition must give way to the speculative affirmation, the opposite of which involves an obvious contradiction, and that liberty and, with it, morality must yield to the mechanism of nature; for the negation of morality involves no contradiction, except on the presupposition of liberty. ->\",\n", - " \"completion\": \" Now morality does not require the speculative cognition of liberty; it is enough that I can think it, that its conception involves no contradiction, that it does not interfere with the mechanism of nature.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"Now morality does not require the speculative cognition of liberty; it is enough that I can think it, that its conception involves no contradiction, that it does not interfere with the mechanism of nature. ->\",\n", - " \"completion\": \" But even this requirement we could not satisfy, if we had not learnt the twofold sense in which things may be taken; and it is only in this way that the doctrine of morality and the doctrine of nature are confined within their proper limits.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But even this requirement we could not satisfy, if we had not learnt the twofold sense in which things may be taken; and it is only in this way that the doctrine of morality and the doctrine of nature are confined within their proper limits. ->\",\n", - " \"completion\": \" For this result, then, we are indebted to a criticism which warns us of our unavoidable ignorance with regard to things in themselves, and establishes the necessary limitation of our theoretical cognition to mere phenomena.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"For this result, then, we are indebted to a criticism which warns us of our unavoidable ignorance with regard to things in themselves, and establishes the necessary limitation of our theoretical cognition to mere phenomena. ->\",\n", - " \"completion\": \" [*Footnote: In order to cognize an object, I must be able to prove its possibility, either from its reality as attested by experience, or a priori, by means of reason.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"[*Footnote: In order to cognize an object, I must be able to prove its possibility, either from its reality as attested by experience, or a priori, by means of reason. ->\",\n", - " \"completion\": \" But I can think what I please, provided only I do not contradict myself; that is, provided my conception is a possible thought, though I may be unable to answer for the existence of a corresponding object in the sum of possibilities.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But I can think what I please, provided only I do not contradict myself; that is, provided my conception is a possible thought, though I may be unable to answer for the existence of a corresponding object in the sum of possibilities. ->\",\n", - " \"completion\": \" But something more is required before I can attribute to such a conception objective validity, that is real possibility\\u2014the other possibility being merely logical.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"But something more is required before I can attribute to such a conception objective validity, that is real possibility\\u2014the other possibility being merely logical. ->\",\n", - " \"completion\": \" We are not, however, confined to theoretical sources of cognition for the means of satisfying this additional requirement, but may derive them from practical sources.]\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"We are not, however, confined to theoretical sources of cognition for the means of satisfying this additional requirement, but may derive them from practical sources.] ->\",\n", - " \"completion\": \" The positive value of the critical principles of pure reason in relation to the conception of God and of the simple nature of the soul, admits of a similar exemplification; but on this point I shall not dwell.\\n\"\n", - "}\n", - "{\n", - " \"prompt\": \"The positive value of the critical principles of pure reason in relation to the conception of God and of the simple nature of the soul, admits of a similar exemplification; but on this point I shall not dwell. ->\",\n", - " \"completion\": \" I cannot even make the assumption\\u2014as the practical interests of morality require\\u2014of God, freedom, and immortality, if I do not deprive speculative reason of its pretensions to transcendent insight.\\n\"\n", - "}\n" - ] - } - ], - "source": [ - "import json\n", - "\n", - "# Open the file and read the lines\n", - "with open('kant_prompts_and_completions_prepared.jsonl', 'r') as f:\n", - " lines = f.readlines()\n", - "\n", - "# Parse and print the first 5 lines\n", - "for line in lines[199:300]:\n", - " data = json.loads(line)\n", - " print(json.dumps(data, indent=4))" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "vh-Nt1HNDReo" - }, - "source": [ - "creating the file on openai" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "c3fQVPVrKozd", - "outputId": "e847d6e1-d2fa-45b1-83f9-0a74d1a3c5d3" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-61tcuEK2PWlzLOJkozBtZqQj\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"file\",\n", - " \"bytes\": 2761402,\n", - " \"created_at\": 1693325418,\n", - " \"status\": \"uploaded\",\n", - " \"status_details\": null\n", - "}" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "openai.File.create(\n", - " file=open(\"/content/kant_prompts_and_completions_prepared.jsonl\", \"rb\"),\n", - " purpose='fine-tune'\n", - ")" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "ERWDRtNu69-4" - }, - "source": [ - "# 2.Fine-tuning a model" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "u8DZg1_3LQfQ" - }, - "outputs": [], - "source": [ - "import os\n", - "import openai\n", - "openai.api_key = os.getenv(\"OPENAI_API_KEY\")\n", - "openai.FineTuningJob.create(training_file=\"file-61tcuEK2PWlzLOJkozBtZqQj\", model=\"babbage-002\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "BP8NpLhxFypD", - "outputId": "2b1e3389-afb0-4589-aeba-783339d1c689" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"object\": \"list\",\n", - " \"data\": [\n", - " {\n", - " \"object\": \"fine_tuning.job\",\n", - " \"id\": \"ftjob-whkMkwaf2WDjJIsezLMC23T3\",\n", - " \"model\": \"babbage-002\",\n", - " \"created_at\": 1693325760,\n", - " \"finished_at\": null,\n", - " \"fine_tuned_model\": null,\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"result_files\": [],\n", - " \"status\": \"running\",\n", - " \"validation_file\": null,\n", - " \"training_file\": \"file-ER2cK59joySxwqaOx7MrbGOD\",\n", - " \"hyperparameters\": {\n", - " \"n_epochs\": 3\n", - " },\n", - " \"trained_tokens\": null\n", - " },\n", - " {\n", - " \"object\": \"fine_tuning.job\",\n", - " \"id\": \"ftjob-XcWeeIdVarCz61BypAWCvBGG\",\n", - " \"model\": \"babbage-002\",\n", - " \"created_at\": 1693236026,\n", - " \"finished_at\": 1693236794,\n", - " \"fine_tuned_model\": \"ft:babbage-002:personal::7sYWloYn\",\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"result_files\": [\n", - " \"file-X1U0CZUBSoCUFkQqzTBo2S0P\"\n", - " ],\n", - " \"status\": \"succeeded\",\n", - " \"validation_file\": \"file-mCLhXE6D5RW7rRzQwEbzCFfo\",\n", - " \"training_file\": \"file-QmcRGPcsCJf6R87OSs5alf3A\",\n", - " \"hyperparameters\": {\n", - " \"n_epochs\": 3\n", - " },\n", - " \"trained_tokens\": 1434834\n", - " },\n", - " {\n", - " \"object\": \"fine_tuning.job\",\n", - " \"id\": \"ftjob-40XaISEdOEoitwxmsGQldiWJ\",\n", - " \"model\": \"babbage-002\",\n", - " \"created_at\": 1693226909,\n", - " \"finished_at\": 1693227408,\n", - " \"fine_tuned_model\": \"ft:babbage-002:personal::7sW5N8i3\",\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"result_files\": [\n", - " \"file-1ihDmqKCzYF726Oc0TuQfWlB\"\n", - " ],\n", - " \"status\": \"succeeded\",\n", - " \"validation_file\": null,\n", - " \"training_file\": \"file-ER2cK59joySxwqaOx7MrbGOD\",\n", - " \"hyperparameters\": {\n", - " \"n_epochs\": 3\n", - " },\n", - " \"trained_tokens\": 1564743\n", - " }\n", - " ],\n", - " \"has_more\": false\n", - "}" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# List 10 fine-tuning jobs\n", - "openai.FineTuningJob.list(limit=10)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "2NwOOlViGwJD", - "outputId": "0054611e-4039-461a-f18c-620068e5c140" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"object\": \"fine_tuning.job\",\n", - " \"id\": \"ftjob-40XaISEdOEoitwxmsGQldiWJ\",\n", - " \"model\": \"babbage-002\",\n", - " \"created_at\": 1693226909,\n", - " \"finished_at\": 1693227408,\n", - " \"fine_tuned_model\": \"ft:babbage-002:personal::7sW5N8i3\",\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"result_files\": [\n", - " \"file-1ihDmqKCzYF726Oc0TuQfWlB\"\n", - " ],\n", - " \"status\": \"succeeded\",\n", - " \"validation_file\": null,\n", - " \"training_file\": \"file-ER2cK59joySxwqaOx7MrbGOD\",\n", - " \"hyperparameters\": {\n", - " \"n_epochs\": 3\n", - " },\n", - " \"trained_tokens\": 1564743\n", - "}" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Retrieve the state of a fine-tune\n", - "openai.FineTuningJob.retrieve(\"ftjob-40XaISEdOEoitwxmsGQldiWJ\")" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "qeJsz10c776f" - }, - "source": [ - "# 3.Running the fine-tuned GPT-3 model\n", - "\n", - "We will now run the model for a completion task\n", - "\n", - "Note: If your fine-tuned model does not appear immediately after the end of the fine-tuning process, you might have to wait until it is processed by OpenAI. You can also:\n", - "\n", - "1.go to the OpenAI Playground to test your model: https://platform.openai.com/playground\n", - "\n", - "2.select your model in the dropdown list and test it in that environment" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 35 - }, - "id": "ntuBwjIN5I13", - "outputId": "fbeb896b-75c3-4ce1-f4a2-efc0a41233ce" - }, - "outputs": [ - { - "data": { - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" - }, - "text/plain": [ - "'ft:babbage-002:personal::7sW5N8i3'" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "f = open(\"drive/MyDrive/files/fine_tune.txt\", \"r\")\n", - "FINE_TUNE=f.readline().strip() #load a saved model(not the fine-tuning job) from a file or load it in this variable\n", - "f.close()\n", - "FINE_TUNE" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "_p0ObKX4SEAo" - }, - "outputs": [], - "source": [ - "prompt = \"Freedom can be a concept or a virtue. ->\"\n", - "response=openai.Completion.create(\n", - " model=FINE_TUNE, #Your model in FINE_TUNE,\n", - " prompt=prompt,\n", - " temperature=1,\n", - " top_p=1,\n", - " frequency_penalty=0,\n", - " presence_penalty=0,\n", - " stop=\"\\n\",\n", - " max_tokens=200\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "oWnmae8ll0FU", - "outputId": "e3e760d8-05ee-4a4d-f3bc-1bc0e64ad33f" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"id\": \"cmpl-7svtb7k0fQd9N3da1AOdYn5o3ZYOw\",\n", - " \"object\": \"text_completion\",\n", - " \"created\": 1693326619,\n", - " \"model\": \"ft:babbage-002:personal::7sW5N8i3\",\n", - " \"choices\": [\n", - " {\n", - " \"text\": \" Human nature is autarchy; therefore, our conduct can be very good, while human nature is very bad, and yet, unless we abandon the idea of liberty, our conduct will be absolutely good.\",\n", - " \"index\": 0,\n", - " \"logprobs\": null,\n", - " \"finish_reason\": \"stop\"\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"prompt_tokens\": 10,\n", - " \"completion_tokens\": 40,\n", - " \"total_tokens\": 50\n", - " }\n", - "}" - ] - }, - "execution_count": 29, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "response" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "TpeSFrqrmYBn", - "outputId": "a41ca670-de71-4de6-ace0-503705b12cf5" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Human nature is autarchy; therefore, our conduct can be very good, while human\n", - "nature is very bad, and yet, unless we abandon the idea of liberty, our conduct\n", - "will be absolutely good.\n" - ] - } - ], - "source": [ - "import textwrap\n", - "generated_text = response['choices'][0]['text']\n", - "\n", - "# Remove leading and trailing whitespace\n", - "generated_text = generated_text.strip()\n", - "\n", - "# Convert to a pretty paragraph by replacing newline characters with spaces\n", - "single_line_response = generated_text.replace('\\n', ' ')\n", - "\n", - "# Use textwrap.fill to nicely format the paragraph to wrap at 80 characters (or whatever width you prefer)\n", - "wrapped_response = textwrap.fill(single_line_response, width=80)\n", - "print(wrapped_response)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "YCZ52flvqVF0" - }, - "source": [ - "# 4.Managing the fine_tunes" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Xrf68bD2Nxug", - "outputId": "f8eea6eb-bfa4-45eb-c8d3-4cf74d6fc2a8" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " \"object\": \"list\",\n", - " \"data\": [\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-qtHQMnZUBv0baFBR1flx5hsZ\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 4,\n", - " \"use_packing\": null,\n", - " \"weight_decay\": 0.0,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"curie\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-vTxiSW78AF8InU3a1FfmyIuX\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1004201,\n", - " \"created_at\": 1631135919,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-UaYjZY2bHGqWujtLt1Bep6qn\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 4888,\n", - " \"created_at\": 1631136236,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1631135920,\n", - " \"updated_at\": 1631136239,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"curie:ft-user-u6to8fv7rsroe5cvku0zfumm-2021-09-08-21-23-53\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-nGWGLgWPTonksokk6c0f2HMS\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 4,\n", - " \"use_packing\": null,\n", - " \"weight_decay\": 0.0,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-02USJi2L1HsPT6RkwMJ5S4NO\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1631355867,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-UYvXR6E7GbFxZciF4twwQAAg\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 4750,\n", - " \"created_at\": 1631355982,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1631355867,\n", - " \"updated_at\": 1631355985,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-user-u6to8fv7rsroe5cvku0zfumm-2021-09-11-10-26-19\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-L3ngtsDSZ3fzGn6ipm33AUsu\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-qimfi96VAFSF0TgJVxXSRvZM\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1639417779,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-YBcjkAQNBPPgvIdNfmbGWwZ2\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 181125,\n", - " \"created_at\": 1639419192,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1639417780,\n", - " \"updated_at\": 1639419194,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-user-u6to8fv7rsroe5cvku0zfumm-2021-12-13-18-13-09\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-lIxhjA4XxmPJ5KORsIGkb9oC\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-EctKSBtTlrS9NQdesrp0S7mc\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1642591534,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-Yft1CLk4bbhP2g5o8NDJr5wD\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 181308,\n", - " \"created_at\": 1642592970,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1642591535,\n", - " \"updated_at\": 1642592973,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-01-19-11-49-27\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-sMSqhlu6PtGiYPpB6MYY7GAo\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-UinyhlDufZFNu66UKB7lfYoP\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1644213797,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-tr1TYWkzuCC41mPBwUYAeNuM\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 180850,\n", - " \"created_at\": 1644215207,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1644213797,\n", - " \"updated_at\": 1644215210,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-02-07-06-26-44\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-lKF7fHigF7VrnkR75DDBhgxN\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-Wv47J7Gb2grLgqTbyQ6ICo38\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1645631463,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-TEZobr9rL36IjwZ2B3GPw8gu\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 181037,\n", - " \"created_at\": 1645632873,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1645631464,\n", - " \"updated_at\": 1645632876,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-02-23-16-14-30\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-RXueKKisaNy2fCOHJ5qLvPUL\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-C0w7OaO5tWvfFPGpmKdm2n2K\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1645632158,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-O0zBrRhGS5NsqSDIHMDK4T3m\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 181180,\n", - " \"created_at\": 1645634280,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1645632159,\n", - " \"updated_at\": 1645634283,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-02-23-16-37-57\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-a2TbBRWy7g5n9zoQZmlQnDSi\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-Q7NISSHxkCwxEtbW34jkkvVJ\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1645632404,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-eHtkVJbek6iWpZMRIRwNYw6a\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 180966,\n", - " \"created_at\": 1645635677,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1645632405,\n", - " \"updated_at\": 1645635680,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-02-23-17-01-14\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-36tIItJL380NzhEqbMTLR3lv\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-rTZwzsFUTiYm9msMEy8rKbm9\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1645632709,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-MXPKw0Vmy0Gxc8VKAH7EnJxY\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 181066,\n", - " \"created_at\": 1645638085,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1645632710,\n", - " \"updated_at\": 1645638088,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-02-23-17-41-22\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-EEVutXUlc8MZck1RrcbrP2Qc\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-k7uTTMPn8lxLEqwXiKkog0yy\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1645632923,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-34W2ab2B9yZXsecrxY63b9o9\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 180940,\n", - " \"created_at\": 1645640482,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1645632923,\n", - " \"updated_at\": 1645640485,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-02-23-18-21-20\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-QQhbcKhX7XrM0Ee5ywpLM7TM\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-nEkywr0j0CgxwBG2Nx3Vcayq\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1645636681,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-cvoVw2MBRcphDGcQ8IffDweq\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 181067,\n", - " \"created_at\": 1645641901,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1645636682,\n", - " \"updated_at\": 1645641904,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-02-23-18-44-59\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-QRcwfEtYarr4iELZllwmKy89\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-yE0EWXO2lmrOGFEX1esEqyIh\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1645639350,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-SMlrCdy2ZsoGXmwQ556H0qwZ\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 181356,\n", - " \"created_at\": 1645643316,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1645639351,\n", - " \"updated_at\": 1645643319,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-02-23-19-08-33\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-t9bPr5lyb53jjmKovOcEjJ8e\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-wG79UVZvnpcdVwRWpG0VCJSL\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1645643269,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-z7WLOh7rrbuVTowkXkCQfek2\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 181235,\n", - " \"created_at\": 1645644738,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1645643270,\n", - " \"updated_at\": 1645644741,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-02-23-19-32-15\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-tsXQm35dhJqgCiD2HFpYEEGe\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 8,\n", - " \"prompt_loss_weight\": 0.1,\n", - " \"learning_rate_multiplier\": 0.05\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-pZWETtHJgAEyDnN8PeEygLgo\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 473322,\n", - " \"created_at\": 1645652099,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-4sqAtdZiDbIl6IrjmMRPr9nc\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 163197,\n", - " \"created_at\": 1645653655,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1645652099,\n", - " \"updated_at\": 1645653658,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2022-02-23-22-00-53\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-mM5WhT4DVkc19Ffl8GrTmyJv\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": null,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": null\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"davinci\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-JujNEuLKbCFJhCTJTiHpIkOO\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1676542409,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [],\n", - " \"created_at\": 1676542409,\n", - " \"updated_at\": 1676543205,\n", - " \"status\": \"failed\",\n", - " \"fine_tuned_model\": null\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-xAslxMat3FqsbYAYGyXQcaAL\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": null,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": null\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"davinci\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-Qx2KkMMWXVkY4sxorqnjfDQE\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1676542684,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [],\n", - " \"created_at\": 1676542684,\n", - " \"updated_at\": 1676543211,\n", - " \"status\": \"failed\",\n", - " \"fine_tuned_model\": null\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-K86JPVaDrftwYUEp9cDRwXjE\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": null,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": null\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"davinci\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-8NLJYaS8ccmBYivs9vZ6xyVc\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1677838259,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [],\n", - " \"created_at\": 1677838259,\n", - " \"updated_at\": 1677838694,\n", - " \"status\": \"failed\",\n", - " \"fine_tuned_model\": null\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-yTCETkTrkrvWsGMRQLzBa3Fi\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-lF5IjxOvC7LyCTi6PbOfu36s\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1678742946,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-R1B0yFnhUOxxuyyUWSOwtsJo\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 180611,\n", - " \"created_at\": 1678745248,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1678742946,\n", - " \"updated_at\": 1678745248,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-03-13-22-07-27\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-KfXdbGMPimrnezybuFZvnhHh\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-I2nh6ncmuCfeAKr9dMQRgD41\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1678743249,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-vJU1hfUNyvgt3MUr1if1fAsb\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 180782,\n", - " \"created_at\": 1678746439,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1678743249,\n", - " \"updated_at\": 1678746440,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-03-13-22-27-18\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-daprSZy6dWb7KlN6WQxOeS0Y\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 16,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-6STHZ9DTBvFBPtWlesr5GVS2\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kantgpt_prepared.jsonl\",\n", - " \"bytes\": 1007925,\n", - " \"created_at\": 1682201268,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-KnyzyuuAx7MQhAKiqWXXbigI\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 180732,\n", - " \"created_at\": 1682203069,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1682201268,\n", - " \"updated_at\": 1682203070,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-04-22-22-37-48\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-VWf1reVYMKIUsoVkKTq6wLh5\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 8,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-3lFv23fBQwwNXxxOmpoxESUL\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kant_prompts_and_completions_prepared.jsonl\",\n", - " \"bytes\": 2761402,\n", - " \"created_at\": 1687193600,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-uST4l8Sw0DBGbu1wTWJ3dPl2\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 182901,\n", - " \"created_at\": 1687196491,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1687193600,\n", - " \"updated_at\": 1687196491,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-06-19-17-41-30\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-sNOmVvZ3fu2cm3XNRCMQuI27\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": null,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": null\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"davinci\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-b3CAoITXZgD6NpAfAv4pWZY3\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kant_prompts_and_completions_prepared.jsonl\",\n", - " \"bytes\": 2761402,\n", - " \"created_at\": 1687194165,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [],\n", - " \"created_at\": 1687194165,\n", - " \"updated_at\": 1687194479,\n", - " \"status\": \"failed\",\n", - " \"fine_tuned_model\": null\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-mPO0qflFKmylUFc6HANwhkOC\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 8,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-dF4n7KualE20Sd8arHc8gCob\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kant_prompts_and_completions_prepared.jsonl\",\n", - " \"bytes\": 2761402,\n", - " \"created_at\": 1687381406,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-2F7zMjQ8eBLErpImduok3yy8\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 182989,\n", - " \"created_at\": 1687383990,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1687381406,\n", - " \"updated_at\": 1687383990,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-06-21-21-46-28\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-jyEvaJftrJxipboRKzEkhyWh\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 8,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-FDPRTY1NXTsFwqGG6bppWu1e\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kant_prompts_and_completions_prepared.jsonl\",\n", - " \"bytes\": 2761402,\n", - " \"created_at\": 1687381898,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-VUVEwU3eZX2O5dvQ4tbEyH5m\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 182890,\n", - " \"created_at\": 1687386265,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1687381898,\n", - " \"updated_at\": 1687386266,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-06-21-22-24-24\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-DUArnJS3hBitXwlyqfalH7Ep\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 8,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-jng9EjuT6G8uZm5ruovoGOT8\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kant_prompts_and_completions_prepared.jsonl\",\n", - " \"bytes\": 2761402,\n", - " \"created_at\": 1687412743,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-uPpp8Jxsv0GlO9u2hgniM4zM\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 182906,\n", - " \"created_at\": 1687413973,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1687412743,\n", - " \"updated_at\": 1687413974,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-06-22-06-06-12\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-4vKh6coQfuOfKwSq6dO5OHUo\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 1,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1,\n", - " \"classification_positive_class\": \" baseball\",\n", - " \"compute_classification_metrics\": true\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-VpPReLAF3CNYfKJQsXU6VoJr\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"sport2_prepared_train.jsonl\",\n", - " \"bytes\": 1519036,\n", - " \"created_at\": 1687424895,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-JotOMlL56cZSbKDWveXtEadL\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"sport2_prepared_valid.jsonl\",\n", - " \"bytes\": 387349,\n", - " \"created_at\": 1687424897,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-5CdA7iXGT6wc6MyluC9E7QcP\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 214966,\n", - " \"created_at\": 1687426872,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1687424897,\n", - " \"updated_at\": 1687426873,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-06-22-09-41-11\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-YXS2MG9ziAEJidnwdoG93cgL\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 1,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1,\n", - " \"classification_positive_class\": \" baseball\",\n", - " \"compute_classification_metrics\": true\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-9c2KSujuFM81MBqqBwDf4MXL\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"sport2_prepared_train.jsonl\",\n", - " \"bytes\": 1519036,\n", - " \"created_at\": 1687438426,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-nGCY6uHgZ5S8tbJFsMHad2tr\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"sport2_prepared_valid.jsonl\",\n", - " \"bytes\": 387349,\n", - " \"created_at\": 1687438436,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-2b8eFh5qM4BQCYihE4LAozfP\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 214915,\n", - " \"created_at\": 1687439593,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1687438436,\n", - " \"updated_at\": 1687439594,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-06-22-13-13-11\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-i9p7IHDhF5L0Gjr5a6dlJLyt\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 1,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1,\n", - " \"classification_positive_class\": \" baseball\",\n", - " \"compute_classification_metrics\": true\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-x2pq76x8Ct43oO0pwnGwpLL9\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"sport2_prepared_train.jsonl\",\n", - " \"bytes\": 1519036,\n", - " \"created_at\": 1687447747,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-1YKvIsRmGRPYdk9c03X6tAqp\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"sport2_prepared_valid.jsonl\",\n", - " \"bytes\": 387349,\n", - " \"created_at\": 1687447753,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-Izu3nJdhSqOBIfI688JR72Lu\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 214963,\n", - " \"created_at\": 1687453017,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1687447753,\n", - " \"updated_at\": 1687453018,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-06-22-16-56-56\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-GAHIYikxW0Eia8a8KC0hplIS\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 1,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1,\n", - " \"classification_positive_class\": \" baseball\",\n", - " \"compute_classification_metrics\": true\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-5julvdjokxdNCAWShRSVAnOC\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"sport2_prepared_train.jsonl\",\n", - " \"bytes\": 1519036,\n", - " \"created_at\": 1687465813,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-8ZGzC5aH5KPXs22vTGNTIkmB\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"sport2_prepared_valid.jsonl\",\n", - " \"bytes\": 387349,\n", - " \"created_at\": 1687466000,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-C1GYkegTEPGA8M2sVT0vqFNz\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 215048,\n", - " \"created_at\": 1687469982,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1687466000,\n", - " \"updated_at\": 1687469982,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-06-22-21-39-41\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-L6kXshOWnppQc3kgBUuq8xCf\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 8,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-YRIdjNnYLIR1IXzBgu1gs6eW\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kant_prompts_and_completions_prepared.jsonl\",\n", - " \"bytes\": 2761402,\n", - " \"created_at\": 1687467299,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-xhrYb8vZuNO00H029Wk3ygd7\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 182815,\n", - " \"created_at\": 1687473488,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1687467299,\n", - " \"updated_at\": 1687473489,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-06-22-22-38-07\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-BDMqCXWP0lU9wZWPlZ1Zh5iM\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 8,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-jygSQePOivygcXMetE3Kl8E5\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"kant_prompts_and_completions_prepared.jsonl\",\n", - " \"bytes\": 2761402,\n", - " \"created_at\": 1688280652,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-nvcMD4ymnxh0VroH6xyR4jc0\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 182460,\n", - " \"created_at\": 1688286800,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1688280652,\n", - " \"updated_at\": 1688286800,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-07-02-08-33-19\"\n", - " },\n", - " {\n", - " \"object\": \"fine-tune\",\n", - " \"id\": \"ft-bmoroNoRBjVCMpmiN5ZCWGmI\",\n", - " \"hyperparams\": {\n", - " \"n_epochs\": 4,\n", - " \"batch_size\": 1,\n", - " \"prompt_loss_weight\": 0.01,\n", - " \"learning_rate_multiplier\": 0.1,\n", - " \"classification_positive_class\": \" baseball\",\n", - " \"compute_classification_metrics\": true\n", - " },\n", - " \"organization_id\": \"org-h2Kjmcir4wyGtqq1mJALLGIb\",\n", - " \"model\": \"ada\",\n", - " \"training_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-4YVuNE10anfjOMFJ2wWwgLom\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"sport2_prepared_train.jsonl\",\n", - " \"bytes\": 1519036,\n", - " \"created_at\": 1688287137,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"validation_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-5NfdCNY31LfcOnvCbQhAyVCJ\",\n", - " \"purpose\": \"fine-tune\",\n", - " \"filename\": \"sport2_prepared_valid.jsonl\",\n", - " \"bytes\": 387349,\n", - " \"created_at\": 1688287145,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"result_files\": [\n", - " {\n", - " \"object\": \"file\",\n", - " \"id\": \"file-55jOj38bPPjvLe4zSOMbzCrQ\",\n", - " \"purpose\": \"fine-tune-results\",\n", - " \"filename\": \"compiled_results.csv\",\n", - " \"bytes\": 214962,\n", - " \"created_at\": 1688292398,\n", - " \"status\": \"processed\",\n", - " \"status_details\": null\n", - " }\n", - " ],\n", - " \"created_at\": 1688287145,\n", - " \"updated_at\": 1688292398,\n", - " \"status\": \"succeeded\",\n", - " \"fine_tuned_model\": \"ada:ft-personal-2023-07-02-10-06-37\"\n", - " }\n", - " ],\n", - " \"next_starting_after\": null\n", - "}\n" - ] - } - ], - "source": [ - "# List all created fine-tunes\n", - "!openai api fine_tunes.list > fine_tunes.json\n", - "!openai api fine_tunes.list" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "juaVC4fgxQnW" - }, - "source": [ - "**ChatGPT PLUS, GPT-4 provides a breakdown of the components of the JSON object**\n", - "\n", - "- `\"object\"`: This line specifies the type of object JSON is representing. Here it's a fine-tuned model.\n", - "\n", - "- `\"id\"`: This is the unique identifier for this fine-tuning job. This ID is typically used to reference this specific instance of fine-tuning.\n", - "\n", - "- `\"hyperparams\"`: These are the hyperparameters used for fine-tuning the model.\n", - " - `\"n_epochs\"`: Number of epochs for the training, i.e., how many times the learning algorithm will work through the entire training dataset.\n", - " - `\"batch_size\"`: The number of training examples used in one iteration (or update) of model parameters.\n", - " - `\"prompt_loss_weight\"`: This is the weight assigned to the loss function of the prompts during training. A higher value places more emphasis on minimizing the loss of the prompts.\n", - " - `\"learning_rate_multiplier\"`: This value is used to scale the learning rate during training. A lower value will cause the model to learn slower and vice versa.\n", - "\n", - "- `\"organization_id\"`: This is the identifier for the organization account under which the fine-tuning operation was performed.\n", - "\n", - "- `\"model\"`: The base model used for fine-tuning. In your case, it's `ada`, which is a version of GPT-3.\n", - "\n", - "- `\"training_files\"`: This array contains information about the files used for training.\n", - " - `\"object\"`: Specifies the object type, in this case, a file.\n", - " - `\"id\"`: The unique identifier for this file.\n", - " - `\"purpose\"`: The purpose of the file, here it's for fine-tuning.\n", - " - `\"filename\"`: The name of the file.\n", - " - `\"bytes\"`: The size of the file in bytes.\n", - " - `\"created_at\"`: The UNIX timestamp for when the file was created.\n", - " - `\"status\"`: The status of the file processing. Here it's processed.\n", - " - `\"status_details\"`: Any extra details about the file's status. It's null here, meaning there are no extra details.\n", - "\n", - "- `\"validation_files\"`: This would include similar details as `\"training_files\"`, but for any files used for validation during training. It's empty in your case.\n", - "\n", - "- `\"result_files\"`: This is an array of files that store the result of the fine-tuning operation. The details of each file are similar to those in `\"training_files\"`.\n", - "\n", - "- `\"created_at\"`: The UNIX timestamp indicating when this fine-tuning job was created.\n", - "\n", - "- `\"updated_at\"`: The UNIX timestamp indicating the last time this fine-tuning job was updated.\n", - "\n", - "- `\"status\"`: The status of the fine-tuning job. In this case, it has succeeded.\n", - "\n", - "- `\"fine_tuned_model\"`: This is the unique identifier/name for the fine-tuned model.\n", - " \n", - "Remember that a UNIX timestamp is the number of seconds that have passed since 00:00:00 Thursday, 1 January 1970, minus leap seconds. Programs like Python's datetime library can convert these to more human-readable formats." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "e4N3bVAC7GNJ" - }, - "outputs": [], - "source": [ - "import pandas as pd\n", - "import json\n", - "from datetime import datetime\n", - "\n", - "# Load data from json file\n", - "with open('fine_tunes.json') as f:\n", - " data = json.load(f)\n", - "\n", - "# Convert to Pandas DataFrame:\n", - "df = pd.json_normalize(data['data'])\n", - "\n", - "# Select specific columns\n", - "selected_columns = ['object', 'id', 'fine_tuned_model','status', 'created_at', 'updated_at']\n", - "df = df[selected_columns]\n", - "\n", - "# Rename columns for display\n", - "column_mapping = {\n", - " 'object': 'Object',\n", - " 'id': 'ID',\n", - " 'fine_tuned_model': 'Fine_Tuned_Model',\n", - " 'filename':'Filename',\n", - " 'status': 'Status',\n", - " 'created_at': 'Created_At',\n", - " 'updated_at': 'Updated_At',\n", - "}\n", - "df.rename(columns=column_mapping, inplace=True)\n", - "\n", - "# Convert UNIX timestamp to standard format\n", - "df['Created_At'] = pd.to_datetime(df['Created_At'], unit='s')\n", - "df['Updated_At'] = pd.to_datetime(df['Updated_At'], unit='s')\n", - "\n", - "df" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -}