How to change default path to save pre-trained model weights

I have limited space in my home directory and would like to change the path fastai saves pre-trained model weights. I recall seeing how to do it somewhere but can’t find it, can anybody help?

Thanks

fastai only downloads a pretrained model in NLP, the other models are downloaded by PyTorch. For fastai, you can specify the location you want in .fastai/config.yml in your home dir. PyTorch has a similar feature I think.

3 Likes

Thanks, I found that in Pytorch you can control where the models are saved by setting the environmental variable $TORCH_HOME

This is useful and can be set either in your .profile file or using %env TORCH_HOME=’/directory_path’