Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HIT-cwh committed Dec 19, 2023
1 parent c174db9 commit 8f56809
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lmdeploy/lite/utils/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8f56809

Please sign in to comment.