File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
applications/DeepSpeed-Chat/dschat/utils/model Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 11[submodule "training/DeepSpeed-Domino/Megatron-LM "]
22 path = training/DeepSpeed-Domino/Megatron-LM
3- url = git@ github.com: NVIDIA/Megatron-LM.git
3+ url = https:// github.com/ NVIDIA/Megatron-LM.git
Original file line number Diff line number Diff line change 1111)
1212from huggingface_hub import snapshot_download
1313from transformers .integrations .deepspeed import HfDeepSpeedConfig
14+ from transformers .modeling_utils import no_init_weights
1415
1516from dschat .utils .model .reward_model import RewardModel
1617from dschat .utils .utils import load_state_dict_into_model , print_rank_0
@@ -99,7 +100,8 @@ def create_hf_model(model_class,
99100 dschf = None
100101 if rlhf_training :
101102 # the weight loading is handled by create critic model
102- model = model_class .from_config (model_config )
103+ with no_init_weights ():
104+ model = model_class .from_config (model_config )
103105 else :
104106 model = model_class .from_pretrained (
105107 model_name_or_path ,
You can’t perform that action at this time.
0 commit comments