-
Notifications
You must be signed in to change notification settings - Fork 629
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
Logging with organization token is successful and leads to side effects #658
Comments
Is the issue reproducible? |
@osanseviero yes, I was able to raise it.
Weird enough, it doesn't happen at all when I login with my own token. So either: login with keras-io token and define this explicitly in the pushing function, (which is cumbersome anyway) |
@SBrandeis are people expected to be able to do login using an organization token? That sounds off no? |
Hi, you need to provide a user access token (https://hf.co/settings/token) to be able to push to an organization We should refrain from logging in with organization tokens and push users towards using their personal user access tokens when authentication is required 🙂 |
Maybe we could put a note in Hub since I didn't know that I wasn't supposed to do it @SBrandeis @osanseviero |
My question is why do we support login with organization tokens at all? What's the use case? |
cc @julien-c as well |
@osanseviero +1, maybe we could explain that as well |
Using an organization API token will work on most API routes that require only read access to repos, as well as with This behavior holds mainly for backward compatibility and will probably be removed at some point in the future. We should not rely on it. As stated before, the preferred way to authenticate programmatically with the hub are user access tokens |
Thanks for the context! In my opinion logging in with organization token should not be supported at all (cc @LysandreJik @muellerzr) since it looks like it's a successful login but can lead to a bunch of side effects. I would feel more comfortable if we error out in login when using organization token in |
Yes, the org API token isn't really thought to be used in the case of hfhub, its main use is rather the inference API (hence its name, different from the users' "access tokens"). Preventing from logging in with it makes sense to me (simple to detect since all org tokens start w/ |
agreed on the proposed fix |
@merveenoyan or @muellerzr would any of you like to take this one? |
I'll try 🤗 |
Other than passing token as an argument, I tested for huggingface-cli. I wonder if we should put a warning along the lines of "If you're logging in to push models, make sure you are using your personal token" when users are logging in with organization token. When pushing I get following which is a bit confusing IMO.
|
Org/API tokens always begin with |
@osanseviero I understood it and fixed for hub mixin and keras mixin, I'm trying to see where else this would fail atm so I'm testing pushing and pulling and if they fail. 👀 I'll write my findings here. |
This confused me
We can simply raise an error here, no need to provide a warning. I don't think you need to change the mixins code itself, though. By changing |
We merged the PR that solves the issue, I'm closing it. |
It was reported that users get KeyError when
push_to_hub_keras()
is used to push for organization.Example:
When organization token is explicitly written, the problem goes away.
Example:
Is this intended behavior? @nateraw
Also cc: @osanseviero
The text was updated successfully, but these errors were encountered: