First off, hello.
Now that the pleasantries are out of the way… let’s just be brutally honest.
You programmers suck at instructions. I mean epically, horrifically, SO(*FDU)(*H bad
Programming is a language and should be taught as such.
I’m here because of a near-miss with my sledgehammer and my computer.
Why? (as if you care, you don’t, but you’re trying to be polite)
Because of this:
" File “e:\Dev\CodeWriter4.0.venv\Lib\site-packages\huggingface_hub\file_download.py”, line 860, in hf_hub_download
return _hf_hub_download_to_cache_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “e:\Dev\CodeWriter4.0.venv\Lib\site-packages\huggingface_hub\file_download.py”, line 1009, in _hf_hub_download_to_cache_dir
_download_to_tmp_and_move(
File “e:\Dev\CodeWriter4.0.venv\Lib\site-packages\huggingface_hub\file_download.py”, line 1543, in _download_to_tmp_and_move
http_get(
File “e:\Dev\CodeWriter4.0.venv\Lib\site-packages\huggingface_hub\file_download.py”, line 455, in http_get
temp_file.write(chunk)
OSError: [Errno 28] No space left on device"
Console barf…
And to my fellow Asperger-types - yes I RTMFM (I added a letter, you figure it out)
I can’t tell you how many times I’ve said “It just can’t be this hard”.
Anyway.
Here was the fix:
os.environ[“HUGGINGFACE_HUB_CACHE”] = r"G:\HuggingFace\hub"
How do I know that was the fix?
Well, for the 97th time I “searched the site” and “read the MFM” and still got “disk full”. So added
os.environ[“HF_HOME”] = r"G:\huggingface"
OSError: [Errno 28] No space left on device"
Then added…
os.environ[“HF_DATASETS_CACHE”] = r"G:\HuggingFace\datasets"
OSError: [Errno 28] No space left on device"
Then added…
os.environ[“HF_MODELS_CACHE”] = r"G:\HuggingFace\models"
OSError: [Errno 28] No space left on device"
Then added…
os.environ[“TRANSFORMERS_CACHE”] = r"G:\HuggingFace\transformers"
OSError: [Errno 28] No space left on device"
Then added…
os.environ[“HF_DATASETS_DOWNLOADED_DATASETS_PATH”] = r"G:\HuggingFace\datasets"
OSError: [Errno 28] No space left on device"
Then finally…
os.environ[“HUGGINGFACE_HUB_CACHE”] = r"G:\HuggingFace\hub"
And since I left the disk full so the process would fail in seconds instead of WASTING another 43 minutes of my life. (which doesn’t seem like much until you add up all the above trials and the fact that it took 43 minutes to fail each time)
In the process, I Googled, “AI’d”, etc., etc., etc., etc., etc.,
I changed, rebooted, took copious notes because I could just hear some schmuck say “well did you try {insert condescending crap you say because you’re an arrogant programmer and unless someone has 234,232 leetcode solves, 1,234,611 Github stars, and 235 commits per day for the last 10 years straight with zero missees (or whatever) they’re just “not that good”}”
(admittedly, dealing with people will do that to you so no blame in the above, just making a blunt observation)
All in an effort to do what should be a simple task.
Why is it so hard to just list all (ALL) of the variables involved?
Sorta like…
"Hey, HuggingFace will need to download a crap ton of data. We’re talking HUNDREDS of gigs. So be careful where you store this crap.
Here’s how we store stuff on your precocious little machine:
dir1
dir2,
etc…
If you want to change these it’s pretty simple
In your code:
examples
If you want to do it another way, figure that crap out because if you start mucking with environment variables, shell variables, session variables… well… your computer will become a smoking pile of hot garbage pretty quickly.
Anyway, simple works is easy to test and debug, so we go with simple!
And we like to keep our docs updated so if this ever is outdated, we will pay the first person to find the mistake $100 cash and publicly flog our entire development team. And it comes out of our lead developer’s pocket so he gets the benefit of TWO painful lessons!
Happy coding!"
Anyway, that’s how I’d run things if I were in charge.
Which is probably why I’m not in charge now that I think about it…
Hope this helps you find your way to changing the download directory, change the download folder or just deal with HuggingFace filling up your MASSIVE hard drive in short order.
And for those of us on the spectrum types, I hope this has been entertaining, enlightening, and if not… sorry about your luck.