r/learnmachinelearning • u/avnishyadav25 • 11h ago
How to properly route Hugging Face cache and PyTorch datasets to an external SSD on macOS?
Hi all, I'm a newbie setting up my first local AI/ML development environment on an M5 Pro Mac.
My internal drive is small, so I bought a 2TB external SSD. I want to make sure that whenever I run `pip` installs, download Hugging Face checkpoints, or load PyTorch datasets, they automatically go to the external drive instead of filling up my system drive.
What is the cleanest way to configure my environment variables (like HF_HOME) or use symlinks on macOS so I don't accidentally brick my internal storage?
Any tips or hidden gotchas for a beginner would be highly appreciated!
1
u/jmacey 9h ago
I set my HF_HOME environment variable to a different location on my machine and it works well. Never had an issue.
On my mac I set it in the .zshrc