From 319bedbc0b26ae207c09bda62c173ef1558ab2a0 Mon Sep 17 00:00:00 2001 From: Daniel King <43149077+dakinggg@users.noreply.github.com> Date: Thu, 6 Jun 2024 02:01:54 -0400 Subject: [PATCH] Fix MPT HF conversion (#1257) (cherry picked from commit 67928cb4d5def4996afe8bc91d2be3bbe42b9aba) --- llmfoundry/utils/huggingface_hub_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llmfoundry/utils/huggingface_hub_utils.py b/llmfoundry/utils/huggingface_hub_utils.py index 3f7b3a0f55..3038014d7f 100644 --- a/llmfoundry/utils/huggingface_hub_utils.py +++ b/llmfoundry/utils/huggingface_hub_utils.py @@ -280,6 +280,9 @@ def edit_files_for_hf_compatibility( for f in files_processed_and_queued } for entrypoint in entrypoint_files: + file_path = os.path.join(folder, entrypoint) + if not os.path.exists(file_path): + continue existing_relative_imports = get_all_relative_imports( os.path.join(folder, entrypoint), )