How to modify path where Torch Hub models are downloaded
When I download models through Torch Hub, models are automatically downloaded in /home/me/.cache/torch.

How can I modify this behavior ?

From official documentation, there is several ways to modify this path.
In priority order :


Calling hub.set_dir()
$TORCH_HOME/hub, if environment variable TORCH_HOME is set.
$XDG_CACHE_HOME/torch/hub, if environment variable XDG_CACHE_HOME is set.
~/.cache/torch/hub


So I just had to do :

export TORCH_HUB=/my/path/



Edit

TORCH_HUB appear to be deprecated, use TORCH_HOME instead
