From 8e4221796194ea5da1bc64b913f12053937563e6 Mon Sep 17 00:00:00 2001 From: Nancy Hung Date: Fri, 25 Oct 2024 16:31:20 -0700 Subject: [PATCH] fix --- llmfoundry/callbacks/hf_checkpointer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llmfoundry/callbacks/hf_checkpointer.py b/llmfoundry/callbacks/hf_checkpointer.py index fe0847c3b5..51d012483f 100644 --- a/llmfoundry/callbacks/hf_checkpointer.py +++ b/llmfoundry/callbacks/hf_checkpointer.py @@ -76,6 +76,11 @@ def _maybe_get_license_filename( If the license file does not exist, returns None. """ + # Early return if no local directory exists + if not os.path.exists(local_dir): + return None + + # Try to find the license file try: license_filename = next( file for file in os.listdir(local_dir)