Commit d7117b95 authored by zhouxiang's avatar zhouxiang
Browse files

同步0.2.6代码

parent 5f83e392
This diff is collapsed.
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from .cli import run from .entrypoint import run
__all__ = ['run'] __all__ = ['run']
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import torch import torch
from transformers import AutoConfig, AutoModelForCausalLM from transformers import AutoConfig, AutoModelForCausalLM
from lmdeploy.pytorch.model import LoadWoInit from lmdeploy.pytorch.accel import LoadNoInit
def load_hf_from_pretrained(pretrained_model_name_or_path, def load_hf_from_pretrained(pretrained_model_name_or_path,
...@@ -26,7 +26,7 @@ def load_hf_from_pretrained(pretrained_model_name_or_path, ...@@ -26,7 +26,7 @@ def load_hf_from_pretrained(pretrained_model_name_or_path,
elif dtype == torch.bfloat16: elif dtype == torch.bfloat16:
hf_config.bf16 = True hf_config.bf16 = True
with LoadWoInit(): with LoadNoInit():
# Load model # Load model
model = AutoModelForCausalLM.from_pretrained( model = AutoModelForCausalLM.from_pretrained(
pretrained_model_name_or_path, config=hf_config, **kwargs) pretrained_model_name_or_path, config=hf_config, **kwargs)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment