How do I customize .cache/huggingface

Hello,
I am fighting with the cache dir location on Win10Pro and I cannot find a solution to change it.
I have tried the following code to force the datasets and models elements download on my E drive and it fails. Surprisingly when I use the same location path in the cache_dir parameter for loading the datasets, it works fine.

os.environ[‘HF_HOME’] = ‘E:\01- NLP Projects\02- Hugging Face\.cache’
os.environ[‘HUGGINGFACE_HUB_CACHE’] = ‘E:\01- NLP Projects\02- Hugging Face\.cache’
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’

Thanks for your help and feedback.

Best regards

Jerome

1 Like