Change cache directory

I am trying to change the default cache directory of where the models are installed to.

I have attempted to change the environment variable

set HF_DATASETS_CACHE=“D:/Users/b/Downloads/cache/”

However, it is still installing in the .cache folder instead. How can I resolve this?

1 Like

I have the same issue here on Win10Pro. In my code, I try to force:
os.environ[‘TRANSFORMERS_CACHE’] = ‘E:\01- NLP Projects\02- Hugging Face\.cache’
os.environ[‘HF_DATASETS_CACHE’] = ‘E:\01- NLP Projects\02- Hugging Face\.cache’

But still, HF is using the default cache directory for both dataset and model elements.
I do not know how to fix it.