From 9c5da8bf001a29ef6e74d7b40b5c3f8e0fe7b0d6 Mon Sep 17 00:00:00 2001 From: James Wade Date: Tue, 23 Jan 2024 18:11:15 -0500 Subject: [PATCH] Add support for offline mode with HF_HUB_OFFLINE envvar --- src/axolotl/cli/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/axolotl/cli/__init__.py b/src/axolotl/cli/__init__.py index d89d676853..d8164f4c8d 100644 --- a/src/axolotl/cli/__init__.py +++ b/src/axolotl/cli/__init__.py @@ -365,6 +365,11 @@ def check_accelerate_default_config(): def check_user_token(): + # Skip check if HF_HUB_OFFLINE is set to True + if os.getenv('HF_HUB_OFFLINE') == '1': + LOG.info("Skipping HuggingFace token verification because HF_HUB_OFFLINE is set to True. Only local files will be used.") + return True + # Verify if token is valid api = HfApi() try: