Skip to content

Commit

Permalink
fix inference mode error
Browse files Browse the repository at this point in the history
  • Loading branch information
irexyc committed Oct 28, 2024
1 parent a8b2765 commit 7334cd2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lmdeploy/pytorch/models/qwen2_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,11 @@ def forward(
inputs_embeds=inputs_embeds,
mrope_position_ids=mrope_position_ids,
)
return hidden_states

logits = self.lm_head(hidden_states)
logits = logits.float()
return logits
def get_logits(self, hidden_states: torch.Tensor):
"""compute logits of the model output."""
return self.lm_head(hidden_states)

def update_weights(self):
"""update weights."""
Expand Down

0 comments on commit 7334cd2

Please sign in to comment.