avoid malloc all missing keys in fp32 (#8600)
This commit is contained in:
parent
3f24202e4c
commit
af201052db
1 changed files with 3 additions and 2 deletions
|
|
@ -115,6 +115,9 @@ class _BaseAutoModelClass:
|
|||
# Speed up when loading model
|
||||
kwargs["low_cpu_mem_usage"] = True
|
||||
|
||||
# set default torch_dtype='auto'
|
||||
kwargs["torch_dtype"] = kwargs.get("torch_dtype", 'auto')
|
||||
|
||||
qtype = ggml_tensor_qtype[bigdl_transformers_low_bit]
|
||||
# Note that the int4 linear layers cannot currently
|
||||
# be recorded in huggingface Pretrained Model or AutoConfig,
|
||||
|
|
@ -125,8 +128,6 @@ class _BaseAutoModelClass:
|
|||
|
||||
# Avoid KeyError
|
||||
kwargs["ignore_mismatched_sizes"] = True
|
||||
# Avoid reading from local file at the first initialization
|
||||
kwargs["state_dict"] = {}
|
||||
|
||||
# Maybe needed when extract_local_archive_file
|
||||
subfolder = kwargs.get("subfolder", "")
|
||||
|
|
|
|||
Loading…
Reference in a new issue