From d79ba7c03bcdb70ebb7bfa1a264596a9fc9c0cea Mon Sep 17 00:00:00 2001 From: Daniel King Date: Mon, 27 May 2024 00:54:57 -0700 Subject: [PATCH] more resilient --- llmfoundry/utils/huggingface_hub_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llmfoundry/utils/huggingface_hub_utils.py b/llmfoundry/utils/huggingface_hub_utils.py index 5f0eaf0e79..3f7b3a0f55 100644 --- a/llmfoundry/utils/huggingface_hub_utils.py +++ b/llmfoundry/utils/huggingface_hub_utils.py @@ -240,10 +240,10 @@ def edit_files_for_hf_compatibility( with open(os.path.join(folder, 'config.json'), 'r') as _f: config = json.load(_f) - # If the config file exists, the entrypoint files are specified in the auto map + # If the config file exists, the entrypoint files would be specified in the auto map entrypoint_files = set() if config_file_exists: - for key, value in config['auto_map'].items(): + for key, value in config.get('auto_map', {}).items(): # Only keep the modeling entrypoints, e.g. AutoModelForCausalLM if 'model' not in key.lower(): continue