Skip to content

Commit

Permalink
debug tensor permute for chatglm in reward
Browse files Browse the repository at this point in the history
  • Loading branch information
sunzeyeah committed May 25, 2023
1 parent fa5457d commit 5ec3e3a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/models/reward.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ def reward(
if self.model_type == "glm":
hidden_states = transformer_outputs.mems[-1]
elif self.model_type == "chatglm":
hidden_states = transformer_outputs[0]
seq_len, batch_size, hidden_size = hidden_states.shape
hidden_states = hidden_states.view(batch_size, seq_len, hidden_size)
hidden_states = transformer_outputs[0].permute(1, 0, 2)
elif self.model_type == "pangu":
hidden_states = transformer_outputs[0]
hidden_states = hidden_states.squeeze(1)
Expand Down

0 comments on commit 5ec3e3a

Please sign in to comment.