Skip to content

Commit 2766c81

Browse files
committed
update error message for corrupted tokens in whoami (#3925)
1 parent 76a00e9 commit 2766c81

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/huggingface_hub/hf_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2091,7 +2091,9 @@ def _inner_whoami(self, token: str) -> dict:
20912091
"Note that HF_TOKEN takes precedence over `hf auth login`."
20922092
)
20932093
elif token == _get_token_from_file():
2094-
error_message += " The token stored is invalid. Please run `hf auth login` to update it."
2094+
error_message += (
2095+
" The token stored is invalid. Please run `hf auth login --force` to set a new token."
2096+
)
20952097
raise HfHubHTTPError(error_message, response=e.response) from e
20962098
if e.response.status_code == 429:
20972099
error_message = (

0 commit comments

Comments
 (0)