Skip to content

Commit c5d1a03

Browse files
committed
return it
1 parent d520273 commit c5d1a03

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/transformers/core_model_loading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ def convert_and_load_state_dict_in_model(
609609

610610
model.inverse_converters = inverse_converters
611611
thread_pool.shutdown(wait=False)
612-
return missing_keys, unexpected_keys, mismatch_keys, misc
612+
return missing_keys, unexpected_keys, mismatch_keys, disk_offload_index, misc
613613

614614

615615
# TODO this is not done yet!

src/transformers/modeling_utils.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4257,18 +4257,20 @@ def _load_pretrained_model(
42574257
else:
42584258
raise ValueError("Neither a state dict nor checkpoint files were found.")
42594259

4260-
missing_keys, unexpected_keys, mismatched_keys, misc = convert_and_load_state_dict_in_model(
4261-
model,
4262-
merged_state_dict,
4263-
weight_mapping,
4264-
tp_plan,
4265-
hf_quantizer,
4266-
dtype,
4267-
device_map,
4268-
model.dtype_plan,
4269-
device_mesh,
4270-
disk_offload_index,
4271-
disk_offload_folder,
4260+
missing_keys, unexpected_keys, mismatched_keys, disk_offload_index, misc = (
4261+
convert_and_load_state_dict_in_model(
4262+
model,
4263+
merged_state_dict,
4264+
weight_mapping,
4265+
tp_plan,
4266+
hf_quantizer,
4267+
dtype,
4268+
device_map,
4269+
model.dtype_plan,
4270+
device_mesh,
4271+
disk_offload_index,
4272+
disk_offload_folder,
4273+
)
42724274
)
42734275

42744276
# finally close all opened file pointers

0 commit comments

Comments
 (0)