From 3c41597113e4509737b7bcaf384846c876e3d1e4 Mon Sep 17 00:00:00 2001 From: Elijah Rwothoromo Date: Tue, 5 Aug 2025 21:53:16 +0300 Subject: [PATCH] More redundancies removed --- .../01_webpage_summarizer.ipynb | 80 +++---------------- week1/day1.ipynb | 2 +- 2 files changed, 13 insertions(+), 69 deletions(-) diff --git a/week1/community-contributions/01_webpage_summarizer.ipynb b/week1/community-contributions/01_webpage_summarizer.ipynb index 8126396..f8be204 100644 --- a/week1/community-contributions/01_webpage_summarizer.ipynb +++ b/week1/community-contributions/01_webpage_summarizer.ipynb @@ -42,65 +42,17 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "ebf2fa36", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Collecting selenium\n", - " Downloading selenium-4.34.2-py3-none-any.whl.metadata (7.5 kB)\n", - "Collecting webdriver-manager\n", - " Downloading webdriver_manager-4.0.2-py2.py3-none-any.whl.metadata (12 kB)\n", - "Requirement already satisfied: urllib3~=2.5.0 in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from urllib3[socks]~=2.5.0->selenium) (2.5.0)\n", - "Collecting trio~=0.30.0 (from selenium)\n", - " Downloading trio-0.30.0-py3-none-any.whl.metadata (8.5 kB)\n", - "Collecting trio-websocket~=0.12.2 (from selenium)\n", - " Downloading trio_websocket-0.12.2-py3-none-any.whl.metadata (5.1 kB)\n", - "Requirement already satisfied: certifi>=2025.6.15 in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from selenium) (2025.7.14)\n", - "Requirement already satisfied: typing_extensions~=4.14.0 in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from selenium) (4.14.1)\n", - "Requirement already satisfied: websocket-client~=1.8.0 in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from selenium) (1.8.0)\n", - "Requirement already satisfied: attrs>=23.2.0 in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from trio~=0.30.0->selenium) (25.3.0)\n", - "Collecting sortedcontainers (from trio~=0.30.0->selenium)\n", - " Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl.metadata (10 kB)\n", - "Requirement already satisfied: idna in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from trio~=0.30.0->selenium) (3.10)\n", - "Collecting outcome (from trio~=0.30.0->selenium)\n", - " Downloading outcome-1.3.0.post0-py2.py3-none-any.whl.metadata (2.6 kB)\n", - "Requirement already satisfied: sniffio>=1.3.0 in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from trio~=0.30.0->selenium) (1.3.1)\n", - "Collecting wsproto>=0.14 (from trio-websocket~=0.12.2->selenium)\n", - " Downloading wsproto-1.2.0-py3-none-any.whl.metadata (5.6 kB)\n", - "Collecting pysocks!=1.5.7,<2.0,>=1.5.6 (from urllib3[socks]~=2.5.0->selenium)\n", - " Downloading PySocks-1.7.1-py3-none-any.whl.metadata (13 kB)\n", - "Requirement already satisfied: requests in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from webdriver-manager) (2.32.4)\n", - "Requirement already satisfied: python-dotenv in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from webdriver-manager) (1.1.1)\n", - "Requirement already satisfied: packaging in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from webdriver-manager) (25.0)\n", - "Requirement already satisfied: h11<1,>=0.9.0 in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from wsproto>=0.14->trio-websocket~=0.12.2->selenium) (0.16.0)\n", - "Requirement already satisfied: charset_normalizer<4,>=2 in /Users/elijahsmac/Desktop/code/llm/llm_engineering/llms/lib/python3.11/site-packages (from requests->webdriver-manager) (3.4.2)\n", - "Downloading selenium-4.34.2-py3-none-any.whl (9.4 MB)\n", - "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m9.4/9.4 MB\u001b[0m \u001b[31m7.0 MB/s\u001b[0m \u001b[33m0:00:01\u001b[0mm \u001b[31m7.2 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\n", - "\u001b[?25hDownloading trio-0.30.0-py3-none-any.whl (499 kB)\n", - "Downloading trio_websocket-0.12.2-py3-none-any.whl (21 kB)\n", - "Downloading PySocks-1.7.1-py3-none-any.whl (16 kB)\n", - "Downloading webdriver_manager-4.0.2-py2.py3-none-any.whl (27 kB)\n", - "Downloading outcome-1.3.0.post0-py2.py3-none-any.whl (10 kB)\n", - "Downloading wsproto-1.2.0-py3-none-any.whl (24 kB)\n", - "Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)\n", - "Installing collected packages: sortedcontainers, wsproto, pysocks, outcome, webdriver-manager, trio, trio-websocket, selenium\n", - "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m8/8\u001b[0m [selenium]━━\u001b[0m \u001b[32m7/8\u001b[0m [selenium]-manager]\n", - "\u001b[1A\u001b[2KSuccessfully installed outcome-1.3.0.post0 pysocks-1.7.1 selenium-4.34.2 sortedcontainers-2.4.0 trio-0.30.0 trio-websocket-0.12.2 webdriver-manager-4.0.2 wsproto-1.2.0\n", - "Note: you may need to restart the kernel to use updated packages.\n" - ] - } - ], + "outputs": [], "source": [ "%pip install selenium webdriver-manager" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "1dcf1d9d-c540-4900-b14e-ad36a28fc822", "metadata": {}, "outputs": [], @@ -140,18 +92,10 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "8598c299-05ca-492e-b085-6bcc2f7dda0d", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "✅ API key loaded successfully!\n" - ] - } - ], + "outputs": [], "source": [ "load_dotenv(override=True)\n", "api_key = os.getenv('OPENAI_API_KEY')\n", @@ -165,7 +109,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "8098defb", "metadata": {}, "outputs": [], @@ -184,7 +128,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "c6fe5114", "metadata": {}, "outputs": [], @@ -289,7 +233,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "02e3a673-a8a1-4101-a441-3816f7ab9e4d", "metadata": {}, "outputs": [], @@ -301,7 +245,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "86bb80f9-9e7c-4825-985f-9b83fe50839f", "metadata": {}, "outputs": [], @@ -315,7 +259,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "89998b18-77aa-4aaf-a137-f0d078d61f75", "metadata": {}, "outputs": [], @@ -391,7 +335,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": ".venv", "language": "python", "name": "python3" }, @@ -405,7 +349,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.7" + "version": "3.12.9" } }, "nbformat": 4, diff --git a/week1/day1.ipynb b/week1/day1.ipynb index 28c951f..f492110 100644 --- a/week1/day1.ipynb +++ b/week1/day1.ipynb @@ -607,7 +607,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.7" + "version": "3.11.12" } }, "nbformat": 4,