From 217e08ded7ccf46560ef0f8ef6da178da86b2e6e Mon Sep 17 00:00:00 2001 From: Edward Donner Date: Fri, 25 Apr 2025 13:25:00 +0200 Subject: [PATCH] Minor fixes --- week2/day2.ipynb | 28 +++++++++------------------- week2/day5.ipynb | 2 +- week5/day5.ipynb | 2 +- week6/day1.ipynb | 2 +- week6/day2.ipynb | 6 +++--- week6/day3.ipynb | 2 +- week6/lite.ipynb | 17 ++++++++++++++--- 7 files changed, 30 insertions(+), 29 deletions(-) diff --git a/week2/day2.ipynb b/week2/day2.ipynb index 28258d2..801bfe0 100644 --- a/week2/day2.ipynb +++ b/week2/day2.ipynb @@ -16,7 +16,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "c44c5494-950d-4d2f-8d4f-b87b57c5b330", "metadata": {}, "outputs": [], @@ -35,7 +35,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "d1715421-cead-400b-99af-986388a97aff", "metadata": {}, "outputs": [], @@ -45,20 +45,10 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "337d5dfc-0181-4e3b-8ab9-e78e0c3f657b", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "OpenAI API Key exists and begins sk-proj-\n", - "Anthropic API Key exists and begins sk-ant-\n", - "Google API Key exists and begins AIzaSyA5\n" - ] - } - ], + "outputs": [], "source": [ "# Load environment variables in a file called .env\n", "# Print the key prefixes to help with any debugging\n", @@ -86,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "22586021-1795-4929-8079-63f5bb4edd4c", "metadata": {}, "outputs": [], @@ -102,7 +92,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "b16e6021-6dc4-4397-985a-6679d6c8ffd5", "metadata": {}, "outputs": [], @@ -114,7 +104,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "02ef9b69-ef31-427d-86d0-b8c799e1c1b1", "metadata": {}, "outputs": [], @@ -292,7 +282,7 @@ "# Let's use Markdown\n", "# Are you wondering why it makes any difference to set system_message when it's not referred to in the code below it?\n", "# I'm taking advantage of system_message being a global variable, used back in the message_gpt function (go take a look)\n", - "# Not a great software engineering practice, but quite sommon during Jupyter Lab R&D!\n", + "# Not a great software engineering practice, but quite common during Jupyter Lab R&D!\n", "\n", "system_message = \"You are a helpful assistant that responds in markdown\"\n", "\n", @@ -578,7 +568,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.11" + "version": "3.11.12" } }, "nbformat": 4, diff --git a/week2/day5.ipynb b/week2/day5.ipynb index 70cee59..11d3ec3 100644 --- a/week2/day5.ipynb +++ b/week2/day5.ipynb @@ -748,7 +748,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.11" + "version": "3.11.12" } }, "nbformat": 4, diff --git a/week5/day5.ipynb b/week5/day5.ipynb index b9643a6..7344c46 100644 --- a/week5/day5.ipynb +++ b/week5/day5.ipynb @@ -475,7 +475,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.11" + "version": "3.11.12" } }, "nbformat": 4, diff --git a/week6/day1.ipynb b/week6/day1.ipynb index 8e18bc5..3035814 100644 --- a/week6/day1.ipynb +++ b/week6/day1.ipynb @@ -429,7 +429,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.11" + "version": "3.11.12" } }, "nbformat": 4, diff --git a/week6/day2.ipynb b/week6/day2.ipynb index 1f89c78..7eb5c8b 100644 --- a/week6/day2.ipynb +++ b/week6/day2.ipynb @@ -43,7 +43,6 @@ "from dotenv import load_dotenv\n", "from huggingface_hub import login\n", "from datasets import load_dataset, Dataset, DatasetDict\n", - "from loaders import ItemLoader\n", "import matplotlib.pyplot as plt\n", "from collections import Counter, defaultdict\n", "import numpy as np\n", @@ -85,8 +84,9 @@ "metadata": {}, "outputs": [], "source": [ - "# One more import after HF login\n", + "# More imports after HF login\n", "\n", + "from loaders import ItemLoader\n", "from items import Item" ] }, @@ -624,7 +624,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.11" + "version": "3.11.12" } }, "nbformat": 4, diff --git a/week6/day3.ipynb b/week6/day3.ipynb index 0b30ebb..9e51979 100644 --- a/week6/day3.ipynb +++ b/week6/day3.ipynb @@ -918,7 +918,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.11" + "version": "3.11.12" } }, "nbformat": 4, diff --git a/week6/lite.ipynb b/week6/lite.ipynb index e359219..502d959 100644 --- a/week6/lite.ipynb +++ b/week6/lite.ipynb @@ -38,8 +38,6 @@ "from dotenv import load_dotenv\n", "from huggingface_hub import login\n", "from datasets import load_dataset, Dataset, DatasetDict\n", - "from items import Item\n", - "from loaders import ItemLoader\n", "import matplotlib.pyplot as plt\n", "from collections import Counter, defaultdict\n", "import numpy as np\n", @@ -74,6 +72,19 @@ "login(hf_token, add_to_git_credential=True)" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "767081df-ee34-4309-ab4c-46d62b4ae367", + "metadata": {}, + "outputs": [], + "source": [ + "# And some more imports - with thanks to Alex C for pointing out that I need to do these after the HF login..\n", + "\n", + "from items import Item\n", + "from loaders import ItemLoader" + ] + }, { "cell_type": "code", "execution_count": null, @@ -416,7 +427,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.10" + "version": "3.11.12" } }, "nbformat": 4,