Change model download folder?

Hello, kinda new to the whole ML/AI landscape, but when I tried using huggingface I immediately ran into a problem, where it basically downloaded the huge models to my windows system drive which is not partitioned big enough to hold these models, nor do I intend to partition it bigger. How do I change the download folder to a different drive where I prepared a place for it?

Changing the HF_HOME environment variable should do it

For latecomers like myself: you can use the huggingface_hub.snapshot_download() method while specifying the local_dir parameter if you don’t want to change the HF_HOME variable.