From aee8ecd7b8d4bf088e0de85fbcf76f4e64f84824 Mon Sep 17 00:00:00 2001 From: Eric Furst Date: Fri, 10 Apr 2026 20:44:24 -0400 Subject: [PATCH] Add PyTorch note and cd-into-directory instructions Scripts use relative paths for data files, so they must be run from their own directory. Also link to PYTORCH.md for GPU setup. Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87e20f4..dd0f30e 100644 --- a/README.md +++ b/README.md @@ -43,17 +43,23 @@ Install [uv](https://docs.astral.sh/uv/getting-started/installation/) (a fast Py uv sync ``` -This creates a `.venv/` virtual environment and installs all dependencies from the lock file. To run scripts: +This creates a `.venv/` virtual environment and installs all dependencies from the lock file. + +**Note:** On Apple Silicon Macs, PyTorch GPU acceleration (MPS) works out of the box. On NVIDIA GPU machines, the default `uv sync` install may be CPU-only and you need to reinstall with CUDA support. See [PYTORCH.md](01-nanogpt/PYTORCH.md) for troubleshooting and device-specific instructions. + +`cd` into the section directory before running scripts or notebooks, since they reference local data files: ```bash -uv run python 05-neural-networks/nn_torch.py +cd 05-neural-networks +uv run python nn_torch.py ``` -Or activate the environment directly: +Or activate the environment and run directly: ```bash source .venv/bin/activate -python 05-neural-networks/nn_torch.py +cd 05-neural-networks +python nn_torch.py ``` ## License