-
Notifications
You must be signed in to change notification settings - Fork 452
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
Should HfApi().login save the token? #154
Comments
Good point! I think the current design is to have the API stateful during the Python runtime, but not across runtimes. As it is designed now, you would need to call the login/retrieve the token from the folder every time you enter a runtime, which I would expect if the expected behavior would be to change the user every time. Since we expect users to have a single account that can manage several namespaces, I would expect the user to be logged in across runtimes, which would point towards making the change you're proposing here. If we wish to go further, the Pinging @julien-c as you designed the current API :) |
no strong opinion |
Also cc @adrinjalali with whom we have had a similar discussion recently. |
Working with the API, I don't think api = HfApi()
api.login(...)
api.create_repo(...) # w/o passing token The user should be able to interact with an instance of |
To remove any confusion, The only login mechanism are |
Currently,
login
only returns the token, but I wonder if it should callsave_token
so it behaves closer to a login.WDYT @LysandreJik? Would it make sense?
The text was updated successfully, but these errors were encountered: