diff --git a/.github/workflows/basic-tests-old-pytorch.yml b/.github/workflows/basic-tests-old-pytorch.yml
index 08fd634..053e619 100644
--- a/.github/workflows/basic-tests-old-pytorch.yml
+++ b/.github/workflows/basic-tests-old-pytorch.yml
@@ -1,4 +1,4 @@
-name: Test PyTorch 2.2 and 2.6
+name: Test PyTorch 2.3 and 2.5
on:
push:
@@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- pytorch-version: [ 2.3.0, 2.6.0 ]
+ pytorch-version: [ 2.3.0, 2.5.0 ]
steps:
- uses: actions/checkout@v4
diff --git a/ch02/01_main-chapter-code/ch02.ipynb b/ch02/01_main-chapter-code/ch02.ipynb
index 938795c..6e7e154 100644
--- a/ch02/01_main-chapter-code/ch02.ipynb
+++ b/ch02/01_main-chapter-code/ch02.ipynb
@@ -179,7 +179,36 @@
"id": "56488f2c-a2b8-49f1-aaeb-461faad08dce",
"metadata": {},
"source": [
- "- (If you encounter an `ssl.SSLCertVerificationError` when executing the previous code cell, it might be due to using an outdated Python version; you can find [more information here on GitHub](https://github.com/rasbt/LLMs-from-scratch/pull/403))"
+ "
\n",
+ "\n",
+ "---\n",
+ "\n",
+ "
\n",
+ "\n",
+ "#### Troubleshooting SSL certificate errors\n",
+ "\n",
+ "- Some readers reported seeing ssl.SSLCertVerificationError: `SSL: CERTIFICATE_VERIFY_FAILED` when running `urllib.request.urlretrieve` in VSCode or Jupyter. \n",
+ "- This usually means Python's certificate bundle is outdated.\n",
+ "\n",
+ "\n",
+ "**Fixes**\n",
+ "\n",
+ "- Use Python ≥ 3.9; you can check your Python version by executing the following code:\n",
+ "```python\n",
+ "import sys\n",
+ "print(sys.__version__)\n",
+ "```\n",
+ "- Upgrade the cert bundle:\n",
+ " - pip: `pip install --upgrade certifi`\n",
+ " - uv: `uv pip install --upgrade certifi`\n",
+ "- Restart the Jupyter kernel after upgrading.\n",
+ "- If you still encounter an `ssl.SSLCertVerificationError` when executing the previous code cell, please see the discussion at [more information here on GitHub](https://github.com/rasbt/LLMs-from-scratch/pull/403)\n",
+ "\n",
+ "
\n",
+ "\n",
+ "---\n",
+ "\n",
+ "
"
]
},
{
diff --git a/pyproject.toml b/pyproject.toml
index 6a098ba..84bbd8e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -9,18 +9,22 @@ description = "Implement a ChatGPT-like LLM in PyTorch from scratch, step by ste
readme = "README.md"
requires-python = ">=3.10,<=3.13"
dependencies = [
- "torch>=2.2.2,<2.6; sys_platform == 'darwin' and platform_machine == 'x86_64'", # Intel macOS
- "torch>=2.3.0; sys_platform != 'darwin' or platform_machine != 'x86_64'",
- "jupyterlab>=4.0",
- "tiktoken>=0.5.1",
- "matplotlib>=3.7.1",
- "tensorflow>=2.16.2; sys_platform == 'darwin' and platform_machine == 'x86_64'", # Intel macOS
- "tensorflow>=2.18.0; sys_platform != 'darwin' or platform_machine != 'x86_64'",
- "tqdm>=4.66.1",
- "numpy>=1.26,<2.1",
- "pandas>=2.2.1",
- "pip>=25.0.1",
- "pytest>=8.3.5",
+ "torch>=2.2.2,<2.6; sys_platform == 'darwin' and platform_machine == 'x86_64' and python_version < '3.13'",
+ "torch>=2.2.2; sys_platform == 'darwin' and platform_machine == 'arm64'",
+ "torch>=2.2.2; sys_platform == 'linux'",
+ "torch>=2.2.2; sys_platform == 'win32'",
+ "tensorflow>=2.16.2; sys_platform == 'darwin' and platform_machine == 'x86_64'",
+ "tensorflow>=2.18.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
+ "tensorflow>=2.18.0; sys_platform == 'linux'",
+ "tensorflow>=2.18.0; sys_platform == 'win32'",
+ "jupyterlab>=4.0",
+ "tiktoken>=0.5.1",
+ "matplotlib>=3.7.1",
+ "tqdm>=4.66.1",
+ "numpy>=1.26,<2.1",
+ "pandas>=2.2.1",
+ "pip>=25.0.1",
+ "pytest>=8.3.5",
]
[tool.uv.sources]
diff --git a/requirements.txt b/requirements.txt
index 26a4c9f..f61d513 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
torch>=2.2.2,<2.6; sys_platform == 'darwin' and platform_machine == 'x86_64' # Intel macOS
-torch >= 2.3.0; sys_platform != 'darwin' or platform_machine != 'x86_64' # all chapters
+torch >= 2.2.2; sys_platform != 'darwin' or platform_machine != 'x86_64' # all chapters
jupyterlab >= 4.0 # all
tiktoken >= 0.5.1 # ch02; ch04; ch05
matplotlib >= 3.7.1 # ch04; ch06; ch07