Skip to content

Commit a275a2a

Browse files
co63ocjerrywgzLokeZhou
authored
Update merge_weight.py (PaddlePaddle#425)
Co-authored-by: wangguanzhong <jerrywgz@126.com> Co-authored-by: LokeZhou <aishenghuoaiqq@163.com>
1 parent 9b349ac commit a275a2a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

paddlemix/examples/blip2/merge_weight.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232
def merge(args):
3333
model_dict = {}
3434
# load the first item: vision_model
35-
visual_encoer_state_dict = paddle.load(args.vision_name_or_path)
36-
for n, p in visual_encoer_state_dict.items():
35+
visual_encoder_state_dict = paddle.load(args.vision_name_or_path)
36+
for n, p in visual_encoder_state_dict.items():
3737
if n.startswith("visual_encoder"):
3838
model_dict[n] = p
3939
else:
40-
model_dict["visual_encoer." + n] = p
40+
model_dict["visual_encoder." + n] = p
4141
logger.info("[1/2] load visual_encoder done!")
4242
# load the second item: Qformer
43-
visual_encoer_state_dict = paddle.load(args.vision_name_or_path)
44-
for n, p in visual_encoer_state_dict.items():
43+
visual_encoder_state_dict = paddle.load(args.vision_name_or_path)
44+
for n, p in visual_encoder_state_dict.items():
4545
if n.startswith("Qformer"):
4646
model_dict[n] = p
4747
else:

0 commit comments

Comments
 (0)