Skip to content

Commit 3bc8e4d

Browse files
authored
Update utility.py (#2079)
1 parent 3df2a21 commit 3bc8e4d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

neural_compressor/torch/utils/utility.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,8 @@ def load_empty_model(pretrained_model_name_or_path, cls=None, **kwargs):
351351
else:
352352
path = dowload_hf_model(pretrained_model_name_or_path)
353353
if cls.__base__ == _BaseAutoModelClass:
354-
config = AutoConfig.from_pretrained(path, **kwargs)
355354
with init_empty_weights():
356-
model = cls.from_config(config, **kwargs)
355+
model = cls.from_pretrained(path, **kwargs)
357356
else: # pragma: no cover
358357
config = cls.config_class.from_pretrained(path, **kwargs)
359358
with init_empty_weights():

0 commit comments

Comments
 (0)