Skip to content

Commit

Permalink
Add support for offline mode with HF_HUB_OFFLINE envvar
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHWade committed Jan 23, 2024
1 parent dc051b8 commit 9c5da8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/axolotl/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9c5da8b

Please sign in to comment.