Setting Huggingface cash in Google Colab notebook to Google Drive

Viewed 7

I am using Google Colab to implement Huggingface code.

What is the best method to change huggingface cash directory in Colab environment to my Google Drive (GDrive), so that we won't need to download the cashed content i.e. language models, datasets...etc. every-time we initiate Colab environment? rather, just redirect huggingface in Colab to use GDrive.

I tried setting the related environment variables in Colab, still, the content is downloaded in Colab runtime environment:

export TRANSFORMERS_CACHE='/content/drive/MyDrive/Colab Notebooks/NLP/HuggingfaceCash'
export HF_DATASETS_CACHE='/content/drive/MyDrive/Colab Notebooks/NLP/HuggingfaceCash/Datasets'
0 Answers
Related