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) <noreply@anthropic.com>
This commit is contained in:
Eric Furst 2026-04-10 20:44:24 -04:00
commit aee8ecd7b8

View file

@ -43,17 +43,23 @@ Install [uv](https://docs.astral.sh/uv/getting-started/installation/) (a fast Py
uv sync 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 ```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 ```bash
source .venv/bin/activate source .venv/bin/activate
python 05-neural-networks/nn_torch.py cd 05-neural-networks
python nn_torch.py
``` ```
## License ## License