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:
parent
794cdaea0d
commit
aee8ecd7b8
1 changed files with 10 additions and 4 deletions
14
README.md
14
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue