"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "efc7460553871cad22921bea39c9e942fa4d773f"
Commit 6190e8ce authored by Philipp Glock's avatar Philipp Glock
Browse files

Fix: use dropout layer

parent 7cc35c31
...@@ -374,6 +374,7 @@ class OpenAIGPTMultipleChoiceHead(nn.Module): ...@@ -374,6 +374,7 @@ class OpenAIGPTMultipleChoiceHead(nn.Module):
# (bsz, num_choices, 1, hidden_size) # (bsz, num_choices, 1, hidden_size)
multiple_choice_h = hidden_states.gather(2, mc_token_ids).squeeze(2) multiple_choice_h = hidden_states.gather(2, mc_token_ids).squeeze(2)
# (bsz, num_choices, hidden_size) # (bsz, num_choices, hidden_size)
multiple_choice_h = self.dropout(multiple_choice_h.transpose(1, 2)).transpose(1, 2)
multiple_choice_logits = self.linear(multiple_choice_h).squeeze(-1) multiple_choice_logits = self.linear(multiple_choice_h).squeeze(-1)
# (bsz, num_choices) # (bsz, num_choices)
return multiple_choice_logits return multiple_choice_logits
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment