diff --git a/pyproject.toml b/pyproject.toml index 02cffbe..9d24504 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,11 +9,13 @@ 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.3.0", + "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'", "jupyterlab>=4.0", "tiktoken>=0.5.1", "matplotlib>=3.7.1", - "tensorflow>=2.18.0", + "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", @@ -38,15 +40,12 @@ line-length = 140 [tool.ruff.lint] exclude = [".venv"] -# Ignored rules (W504 removed) ignore = [ "C406", "E226", "E402", "E702", "E703", "E722", "E731", "E741" ] - # `llms_from_scratch` PyPI package - [tool.setuptools] package-dir = {"" = "pkg"} diff --git a/requirements.txt b/requirements.txt index 3940856..48c4971 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,10 @@ -torch >= 2.3.0 # all +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' # all chapters jupyterlab >= 4.0 # all tiktoken >= 0.5.1 # ch02; ch04; ch05 matplotlib >= 3.7.1 # ch04; ch06; ch07 -tensorflow >= 2.18.0 # ch05; ch06; ch07 +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 pandas >= 2.2.1 # ch06