From ea4b6c4e5fb5a4e9af40fa88ab0db627bf3eb35e Mon Sep 17 00:00:00 2001 From: rasbt Date: Mon, 1 Jan 2024 19:41:18 +0100 Subject: [PATCH] add package versions to the top of the notebook --- ch02/01_main-chapter-code/ch02.ipynb | 33 ++++++++++++++++++++++ ch02/01_main-chapter-code/dataloader.ipynb | 25 ++++++++++++++++ ch03/01_main-chapter-code/ch03.ipynb | 31 +++++++++++++++++++- 3 files changed, 88 insertions(+), 1 deletion(-) diff --git a/ch02/01_main-chapter-code/ch02.ipynb b/ch02/01_main-chapter-code/ch02.ipynb index 790176f..5c9cfae 100644 --- a/ch02/01_main-chapter-code/ch02.ipynb +++ b/ch02/01_main-chapter-code/ch02.ipynb @@ -8,6 +8,39 @@ "# Chapter 2: Working with Text" ] }, + { + "cell_type": "markdown", + "id": "76d5d2c0-cba8-404e-9bf3-71a218cae3cf", + "metadata": {}, + "source": [ + "Packages that are being used in this notebook:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "4d1305cf-12d5-46fe-a2c9-36fb71c5b3d3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torch version: 2.0.1\n", + "tiktoken version: 0.5.1\n" + ] + } + ], + "source": [ + "from importlib.metadata import version\n", + "\n", + "import tiktoken\n", + "import torch\n", + "\n", + "print(\"torch version:\", version(\"torch\"))\n", + "print(\"tiktoken version:\", version(\"tiktoken\"))" + ] + }, { "cell_type": "markdown", "id": "2417139b-2357-44d2-bd67-23f5d7f52ae7", diff --git a/ch02/01_main-chapter-code/dataloader.ipynb b/ch02/01_main-chapter-code/dataloader.ipynb index 5b14121..be9b7eb 100644 --- a/ch02/01_main-chapter-code/dataloader.ipynb +++ b/ch02/01_main-chapter-code/dataloader.ipynb @@ -18,6 +18,31 @@ "This notebook contains the main takeaway, the data loading pipeline without the intermediate steps." ] }, + { + "cell_type": "code", + "execution_count": 2, + "id": "93804da5-372b-45ff-9ef4-8398ba1dd78e", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torch version: 2.0.1\n", + "tiktoken version: 0.5.1\n" + ] + } + ], + "source": [ + "from importlib.metadata import version\n", + "\n", + "import tiktoken\n", + "import torch\n", + "\n", + "print(\"torch version:\", version(\"torch\"))\n", + "print(\"tiktoken version:\", version(\"tiktoken\"))" + ] + }, { "cell_type": "code", "execution_count": 2, diff --git a/ch03/01_main-chapter-code/ch03.ipynb b/ch03/01_main-chapter-code/ch03.ipynb index ad80326..64fcd77 100644 --- a/ch03/01_main-chapter-code/ch03.ipynb +++ b/ch03/01_main-chapter-code/ch03.ipynb @@ -8,6 +8,35 @@ "# Chapter 3: Understanding Attention Mechanisms" ] }, + { + "cell_type": "markdown", + "id": "c29bcbe8-a034-43a2-b557-997b03c9882d", + "metadata": {}, + "source": [ + "Packages that are being used in this notebook:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "e58f33e8-5dc9-4dd5-ab84-5a011fa11d92", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torch version: 2.0.1\n" + ] + } + ], + "source": [ + "from importlib.metadata import version\n", + "import torch\n", + "\n", + "print(\"torch version:\", version(\"torch\"))" + ] + }, { "cell_type": "markdown", "id": "ecc4dcee-34ea-4c05-9085-2f8887f70363", @@ -1760,7 +1789,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.4" } }, "nbformat": 4,