Skip to content

Commit

Permalink
Display endpoint URL in whoami command (#895)
Browse files Browse the repository at this point in the history
* Display endpoint URL in whoami command

* Add missing comma

* Sort imports

* Don't display endpoint name in 'whoami' for the public hub

* Proposal

Co-authored-by: Julien Simon <julsimon@huggingface.co>
Co-authored-by: Lysandre <lysandre.debut@reseau.eseo.fr>
  • Loading branch information
3 people authored Jul 27, 2022
1 parent 99ab73c commit 9e36e7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/huggingface_hub/commands/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from huggingface_hub.commands import BaseHuggingfaceCLICommand
from huggingface_hub.constants import (
ENDPOINT,
REPO_TYPES,
REPO_TYPES_URL_PREFIXES,
SPACES_SDK_TYPES,
Expand Down Expand Up @@ -187,6 +188,9 @@ def run(self):
orgs = [org["name"] for org in info["orgs"]]
if orgs:
print(ANSI.bold("orgs: "), ",".join(orgs))

if ENDPOINT != "https://huggingface.co":
print(f"Authenticated through private endpoint: {ENDPOINT}")
except HTTPError as e:
print(e)
print(ANSI.red(e.response.text))
Expand Down

0 comments on commit 9e36e7a

Please sign in to comment.