From 5b2e3f00ce2622c04adccded1a7a9ce44513d80d Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Sun, 22 Mar 2026 09:11:17 -0400 Subject: [PATCH] fix: handle connection errors when checking user whoami (#3529) --- src/axolotl/cli/checks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/axolotl/cli/checks.py b/src/axolotl/cli/checks.py index 254da8bae..c79cff9f5 100644 --- a/src/axolotl/cli/checks.py +++ b/src/axolotl/cli/checks.py @@ -3,6 +3,7 @@ import os from pathlib import Path +import httpcore from accelerate.commands.config import config_args from huggingface_hub import HfApi from huggingface_hub.utils import LocalTokenNotFoundError @@ -47,7 +48,7 @@ def check_user_token() -> bool: "Error verifying HuggingFace token. Remember to log in using `hf auth login` and get your access token from https://huggingface.co/settings/tokens if you want to use gated models or datasets." ) return False - except HTTPError: + except (HTTPError, httpcore.ConnectError): LOG.warning( "Error accessing HuggingFace. This may be due to a network issue or rate limiting." )