From d1ac2a0d19b3ab8a41b38b0e296850a86e141d62 Mon Sep 17 00:00:00 2001 From: DesmonDay <908660116@qq.com> Date: Fri, 29 Nov 2024 11:46:33 +0800 Subject: [PATCH] fix load missing keys --- paddlenlp/trainer/unified_checkpoint/check_completion.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paddlenlp/trainer/unified_checkpoint/check_completion.py b/paddlenlp/trainer/unified_checkpoint/check_completion.py index 626d25875740..258bd0400761 100644 --- a/paddlenlp/trainer/unified_checkpoint/check_completion.py +++ b/paddlenlp/trainer/unified_checkpoint/check_completion.py @@ -186,6 +186,8 @@ def check_dynamic_load(args, weight_map, existed_files, is_master_weights=False, state_dict = get_expected_state_dict(model) for key in state_dict.keys(): + if key in model._keys_to_ignore_on_load_missing or key in model._keys_to_ignore_on_load_unexpected: + continue if sharding_group.nranks > 1: static_name = struct2static_name_mappings.get(key, None) param_rank = param2rank.get(static_name, None)