Skip to content

Commit ff3a22d

Browse files
authored
Revert "fix init weights issue for critic/reward model (#983)"
This reverts commit 3d83278.
1 parent 3d83278 commit ff3a22d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

applications/DeepSpeed-Chat/dschat/utils/model/model_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
)
1212
from huggingface_hub import snapshot_download
1313
from transformers.integrations.deepspeed import HfDeepSpeedConfig
14-
from transformers.modeling_utils import no_init_weights
1514

1615
from dschat.utils.model.reward_model import RewardModel
1716
from dschat.utils.utils import load_state_dict_into_model, print_rank_0
@@ -100,8 +99,7 @@ def create_hf_model(model_class,
10099
dschf = None
101100
if rlhf_training:
102101
# the weight loading is handled by create critic model
103-
with no_init_weights():
104-
model = model_class.from_config(model_config)
102+
model = model_class.from_config(model_config)
105103
else:
106104
model = model_class.from_pretrained(
107105
model_name_or_path,

0 commit comments

Comments
 (0)