Skip to content

Commit 18c6b97

Browse files
authored
Add additional notes on debugging SSL issues (#810)
* Add SSL instructions * update old pytorch tests * update * update * update * update * update * update * update * update
1 parent 290fa10 commit 18c6b97

File tree

4 files changed

+49
-16
lines changed

4 files changed

+49
-16
lines changed

.github/workflows/basic-tests-old-pytorch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test PyTorch 2.2 and 2.6
1+
name: Test PyTorch 2.3 and 2.5
22

33
on:
44
push:
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
matrix:
26-
pytorch-version: [ 2.3.0, 2.6.0 ]
26+
pytorch-version: [ 2.3.0, 2.5.0 ]
2727

2828
steps:
2929
- uses: actions/checkout@v4

ch02/01_main-chapter-code/ch02.ipynb

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,36 @@
179179
"id": "56488f2c-a2b8-49f1-aaeb-461faad08dce",
180180
"metadata": {},
181181
"source": [
182-
"- (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))"
182+
"<br>\n",
183+
"\n",
184+
"---\n",
185+
"\n",
186+
"<br>\n",
187+
"\n",
188+
"#### Troubleshooting SSL certificate errors\n",
189+
"\n",
190+
"- Some readers reported seeing ssl.SSLCertVerificationError: `SSL: CERTIFICATE_VERIFY_FAILED` when running `urllib.request.urlretrieve` in VSCode or Jupyter. \n",
191+
"- This usually means Python's certificate bundle is outdated.\n",
192+
"\n",
193+
"\n",
194+
"**Fixes**\n",
195+
"\n",
196+
"- Use Python ≥ 3.9; you can check your Python version by executing the following code:\n",
197+
"```python\n",
198+
"import sys\n",
199+
"print(sys.__version__)\n",
200+
"```\n",
201+
"- Upgrade the cert bundle:\n",
202+
" - pip: `pip install --upgrade certifi`\n",
203+
" - uv: `uv pip install --upgrade certifi`\n",
204+
"- Restart the Jupyter kernel after upgrading.\n",
205+
"- 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",
206+
"\n",
207+
"<br>\n",
208+
"\n",
209+
"---\n",
210+
"\n",
211+
"<br>"
183212
]
184213
},
185214
{

pyproject.toml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@ description = "Implement a ChatGPT-like LLM in PyTorch from scratch, step by ste
99
readme = "README.md"
1010
requires-python = ">=3.10,<=3.13"
1111
dependencies = [
12-
"torch>=2.2.2,<2.6; sys_platform == 'darwin' and platform_machine == 'x86_64'", # Intel macOS
13-
"torch>=2.3.0; sys_platform != 'darwin' or platform_machine != 'x86_64'",
14-
"jupyterlab>=4.0",
15-
"tiktoken>=0.5.1",
16-
"matplotlib>=3.7.1",
17-
"tensorflow>=2.16.2; sys_platform == 'darwin' and platform_machine == 'x86_64'", # Intel macOS
18-
"tensorflow>=2.18.0; sys_platform != 'darwin' or platform_machine != 'x86_64'",
19-
"tqdm>=4.66.1",
20-
"numpy>=1.26,<2.1",
21-
"pandas>=2.2.1",
22-
"pip>=25.0.1",
23-
"pytest>=8.3.5",
12+
"torch>=2.2.2,<2.6; sys_platform == 'darwin' and platform_machine == 'x86_64' and python_version < '3.13'",
13+
"torch>=2.2.2; sys_platform == 'darwin' and platform_machine == 'arm64'",
14+
"torch>=2.2.2; sys_platform == 'linux'",
15+
"torch>=2.2.2; sys_platform == 'win32'",
16+
"tensorflow>=2.16.2; sys_platform == 'darwin' and platform_machine == 'x86_64'",
17+
"tensorflow>=2.18.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
18+
"tensorflow>=2.18.0; sys_platform == 'linux'",
19+
"tensorflow>=2.18.0; sys_platform == 'win32'",
20+
"jupyterlab>=4.0",
21+
"tiktoken>=0.5.1",
22+
"matplotlib>=3.7.1",
23+
"tqdm>=4.66.1",
24+
"numpy>=1.26,<2.1",
25+
"pandas>=2.2.1",
26+
"pip>=25.0.1",
27+
"pytest>=8.3.5",
2428
]
2529

2630
[tool.uv.sources]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
torch>=2.2.2,<2.6; sys_platform == 'darwin' and platform_machine == 'x86_64' # Intel macOS
2-
torch >= 2.3.0; sys_platform != 'darwin' or platform_machine != 'x86_64' # all chapters
2+
torch >= 2.2.2; sys_platform != 'darwin' or platform_machine != 'x86_64' # all chapters
33
jupyterlab >= 4.0 # all
44
tiktoken >= 0.5.1 # ch02; ch04; ch05
55
matplotlib >= 3.7.1 # ch04; ch06; ch07

0 commit comments

Comments
 (0)