Skip to content

Commit

Permalink
Update minigpt4.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mzr1996 authored Jul 28, 2023
1 parent d84cd91 commit 65e0f17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mmpretrain/models/multimodal/minigpt4/minigpt4.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def __init__(self,
state_dict = CheckpointLoader.load_checkpoint(
q_former_model_weight)['state_dict']
self.load_state_dict(state_dict, strict=False)
# The ln_vision weights are also in the q-former checkpoint.
setattr(self.ln_vision, 'is_init', True)
setattr(self.q_former, 'is_init', True)

if freeze_q_former:
Expand Down

0 comments on commit 65e0f17

Please sign in to comment.