Sharing downloaded models between users

I’d like several users to share downloaded models, such that when any of the users downloads a model, e.g. using

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

the other users would be able to use it as well for inference, without having to download it again. The users would all be using linux, but may use different hosts, have different python environments and package versions, etc. So, I’ve thought creating a shared NFS mount, e.g. /models and mount it on all hosts. Then, for each user, symlink their HF cache hub dir to a shared path. E.g. ln -s /models ~/.cache/huggingface/hub.

I don’t want to symlink ~/.cache/huggingface/, since it also contains a personal HF token, and modules.

Assuming we can configure file permissions properly, could there still be issues such as:

  • conflicts between different versions of packages, virtualenv/conda envs etc.
  • file locking issues
2 Likes

Did you implement this yet? I was thinking of doing something similar as downloading the same multi-gigabyte models on different computers in the network is not fun.