-
Notifications
You must be signed in to change notification settings - Fork 942
Description
Is your feature request related to a problem? Please describe.
My team is concerned about accidentally uploading our (internal) models to the Hub. It's not a matter of if, but when. We're looking for ways to make it harder for people to accidentally do things that could be laborious to clean up at minimum or constitute a breach of company information security.
Describe the solution you'd like
Having little familiarity with the codebase, perhaps an environment variable would suffice.
Based on a really quick review of the codebase, I think these are the functions/methods that would need a check of that envvar, as early as possible so no action is taken:
| def upload_large_folder_internal( |
| def __init__(self, args: Namespace) -> None: |
| def __init__(self, args: Namespace) -> None: |
huggingface_hub/src/huggingface_hub/hf_api.py
Line 4268 in 7123262
| def upload_file( |
huggingface_hub/src/huggingface_hub/hf_api.py
Line 4476 in 7123262
| def upload_folder( |
Describe alternatives you've considered
A config file. It seems that the huggingface_hub library/CLI stores a token in ${XDG_CACHE_DIR}/huggingface/token but there are no hits when searching the documentation for .config or variations on ${XDG_CONFIG_DIR}. This feature is not significant enough to warrant the introduction of a config file.
A flag file. Dovetailing off the above alternative, perhaps the presence of a file, e.g. ${XDG_CACHE_DIR/huggingface/disable_uploads would suffice. However, it's a heavier solution than an environment variable for macOS and Linux, our dev envs. Conversely, Windows users might prefer that since setting environment variables in Windows is more complex.
Enterprise Hub. This is not a consideration for our team, as we're consuming public models and have solutions for handling any internally-trained models.
Internal fork with uploading code removed. I don't think anyone wants that maintenance burden 😉
Additional context
Add any other context or screenshots about the feature request here.