Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting HuggingFace token overwrites token on remote endpoint/host without confirmation. #202

Open
JosephCatrambone opened this issue Dec 14, 2024 · 0 comments

Comments

@JosephCatrambone
Copy link

When using the UI on a machine, one can set the HuggingFace token via the settings window. If one does this, the token is stored on the remote endpoint and overwrites the .cache on that machine without confirmation:

INFO:     192.168.1.103:52298 - "GET /config/set?k=HuggingfaceUserAccessToken&v=[token here] HTTP/1.1" 200 OK
The token has not been saved to the git credentials helper. Pass `add_to_git_credential=True` in this function directly or `--add-to-git-credential` if using via `huggingface-cli` if you want to set the git credential as well.
Token is valid (permission: fineGrained).
Your token has been saved to /home/joseph/.cache/huggingface/token
Login successful
INFO:     192.168.1.103:52298 - "GET /model/login_to_huggingface HTTP/1.1" 200 OK

This overwrites the previous token without confirmation. This is somewhat problematic because one cannot undo the save or see the old token on HuggingFace. It has to be regenerated, which isn't difficult but can cause issues if there are other long-lived applications on the remote machine. It means other applications using the token also have to be restarted.

Suggestions:

  1. If the remote machine already has a HuggingFace token set, it might be worth noting this in the 'set token' UI and either warning or blanking it out.
  2. Cache the token on the machine that's doing the setting. I know this one is fairly difficult because of how the HuggingFace CLI tools handle reading things from the global shared cache, but it might be nice if it's an option and gives better support for multi-tenancy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant