Skip to content

Commit 4adcdb8

Browse files
authored
解决PeftModel.from_pretrained加载权重前后dtype不一致的问题 (#2007)
1 parent b228c1d commit 4adcdb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mindnlp/core/nn/modules/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict,
772772
setattr(self, name, input_param)
773773
else:
774774
param.data_sync(True)
775-
dtype = param.dtype
775+
dtype = input_param.dtype
776776
param.assign_value(input_param)
777777
param.set_dtype(dtype)
778778
except Exception as ex:

0 commit comments

Comments
 (0)