For discussion: FileStorage currently allows arbitrary paths as directory. This could end up with surprising effects if users mistype.
It might be safer to constrain the storage location to lie within a specified part of the file system. Similarly to how all things the transformers library writes to disk end up inside .cache/huggingface/hub.
One option for handling this functionality is to use https://github.com/cthoyt/pystow (which is used e.g. by the excellent PyKeen library)
For discussion:
FileStoragecurrently allows arbitrary paths asdirectory. This could end up with surprising effects if users mistype.It might be safer to constrain the storage location to lie within a specified part of the file system. Similarly to how all things the transformers library writes to disk end up inside
.cache/huggingface/hub.One option for handling this functionality is to use https://github.com/cthoyt/pystow (which is used e.g. by the excellent
PyKeenlibrary)