Skip to content

Commit

Permalink
Merge branch 'Vision-CAIR:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
TsuTikgiau authored Oct 23, 2023
2 parents 0c27a75 + 41c050d commit f118d7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion minigpt4/models/modeling_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def forward(
)

hidden_states = outputs[0]
if self.config.pretraining_tp > 1:
if hasattr(self.config, 'pretraining_tp') and self.config.pretraining_tp > 1:
lm_head_slices = self.lm_head.weight.split(self.vocab_size // self.config.pretraining_tp, dim=0)
logits = [F.linear(hidden_states, lm_head_slices[i]) for i in range(self.config.pretraining_tp)]
logits = torch.cat(logits, dim=-1)
Expand Down

0 comments on commit f118d7d

Please sign in to comment.