Skip to content

Commit 8519f0d

Browse files
hanouticelinaWauplin
authored andcommitted
log a message when HF_TOKEN is set in auth list (#3608)
1 parent d0bc914 commit 8519f0d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/huggingface_hub/_login.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ def auth_list() -> None:
192192
tokens = get_stored_tokens()
193193

194194
if not tokens:
195-
logger.info("No access tokens found.")
195+
if _get_token_from_environment():
196+
logger.info("No stored access tokens found.")
197+
logger.warning("Note: Environment variable `HF_TOKEN` is set and is the current active token.")
198+
else:
199+
logger.info("No access tokens found.")
196200
return
197201
# Find current token
198202
current_token = get_token()

0 commit comments

Comments
 (0)