From 623dc65d5d062f2c3cbbb7b6352faf668c50e94c Mon Sep 17 00:00:00 2001 From: Sebastian Raschka Date: Thu, 4 Sep 2025 15:07:46 -0500 Subject: [PATCH] Update requirements for Intel Macs (#807) --- pyproject.toml | 8 ++++---- requirements.txt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9d24504..eda4c4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,14 +7,14 @@ name = "llms-from-scratch" version = "1.0.18" description = "Implement a ChatGPT-like LLM in PyTorch from scratch, step by step" readme = "README.md" -requires-python = ">=3.10,<3.13" +requires-python = ">=3.10,<=3.13" dependencies = [ - "torch==2.2.2; sys_platform == 'darwin' and platform_machine == 'x86_64'", # Intel macOS - "torch>=2.3.0; sys_platform != 'darwin' or platform_machine != 'x86_64'", + "torch>=2.2.2,<2.6; sys_platform == 'darwin' and platform_machine == 'x86_64'", # Intel macOS + "torch>=2.3.0,<2.6; 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.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", diff --git a/requirements.txt b/requirements.txt index 48c4971..26a4c9f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ -torch == 2.2.2; sys_platform == 'darwin' and platform_machine == 'x86_64' # Intel macOS +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 jupyterlab >= 4.0 # all tiktoken >= 0.5.1 # ch02; ch04; ch05 matplotlib >= 3.7.1 # ch04; ch06; ch07 -tensorflow == 2.16.2; sys_platform == 'darwin' and platform_machine == 'x86_64' # Intel macOS +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' # ch05; ch06; ch07 tqdm >= 4.66.1 # ch05; ch07 numpy >= 1.26, < 2.1 # dependency of several other libraries like torch and pandas