From 8f56809c17e4e0fa1da593621484f23303b75fd6 Mon Sep 17 00:00:00 2001 From: HIT-cwh <2892770585@qq.com> Date: Tue, 19 Dec 2023 16:10:19 +0800 Subject: [PATCH] fix comments --- lmdeploy/lite/utils/load.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lmdeploy/lite/utils/load.py b/lmdeploy/lite/utils/load.py index 3ab81aaf31..f24b9216b4 100644 --- a/lmdeploy/lite/utils/load.py +++ b/lmdeploy/lite/utils/load.py @@ -4,8 +4,8 @@ from accelerate import infer_auto_device_map, init_empty_weights from transformers import AutoConfig, AutoModelForCausalLM -from lmdeploy.legacy.pytorch.model import LoadWoInit from lmdeploy.lite.utils import collect_target_modules +from lmdeploy.pytorch.accel import LoadNoInit LAYER_TYPE_MAP = { 'InternLMForCausalLM': 'InternLMDecoderLayer', @@ -44,7 +44,7 @@ def load_hf_from_pretrained(pretrained_model_name_or_path, **kwargs): device_map[name] = 0 if 'device_map' in kwargs: kwargs.pop('device_map') - with LoadWoInit(): + with LoadNoInit(): model = AutoModelForCausalLM.from_pretrained( pretrained_model_name_or_path, device_map=device_map,