Skip to content

Commit 937e7e4

Browse files
committed
return it
1 parent 95dbb9e commit 937e7e4

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
@@ -613,7 +613,7 @@ def convert_and_load_state_dict_in_model(
613613

614614
model.inverse_converters = inverse_converters
615615
thread_pool.shutdown(wait=False)
616-
return missing_keys, unexpected_keys, mismatch_keys, misc
616+
return missing_keys, unexpected_keys, mismatch_keys, disk_offload_index, misc
617617

618618

619619
# 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
@@ -4239,18 +4239,20 @@ def _load_pretrained_model(
42394239
else:
42404240
raise ValueError("Neither a state dict nor checkpoint files were found.")
42414241

4242-
missing_keys, unexpected_keys, mismatched_keys, misc = convert_and_load_state_dict_in_model(
4243-
model,
4244-
merged_state_dict,
4245-
weight_mapping,
4246-
tp_plan,
4247-
hf_quantizer,
4248-
dtype,
4249-
device_map,
4250-
model.dtype_plan,
4251-
device_mesh,
4252-
disk_offload_index,
4253-
disk_offload_folder,
4242+
missing_keys, unexpected_keys, mismatched_keys, disk_offload_index, misc = (
4243+
convert_and_load_state_dict_in_model(
4244+
model,
4245+
merged_state_dict,
4246+
weight_mapping,
4247+
tp_plan,
4248+
hf_quantizer,
4249+
dtype,
4250+
device_map,
4251+
model.dtype_plan,
4252+
device_mesh,
4253+
disk_offload_index,
4254+
disk_offload_folder,
4255+
)
42544256
)
42554257

42564258
# finally close all opened file pointers

0 commit comments

Comments
 (0)