@@ -884,7 +884,7 @@ class RoFormerModel(RoFormerPreTrainedModel):
884884 input to the forward pass.
885885 """
886886
887- def __init__ (self , config , add_pooling_layer = False ):
887+ def __init__ (self , config , add_pooling_layer = True ):
888888 super ().__init__ (config )
889889 self .config = config
890890 self .embeddings = RoFormerEmbeddings (config )
@@ -1083,7 +1083,7 @@ def __init__(self, config):
10831083 "bi-directional self-attention."
10841084 )
10851085
1086- self .roformer = RoFormerModel (config , add_pooling_layer = True )
1086+ self .roformer = RoFormerModel (config , add_pooling_layer = False )
10871087 self .cls = RoFormerOnlyMLMHead (config )
10881088
10891089 self .init_weights ()
@@ -1204,7 +1204,7 @@ def __init__(self, config):
12041204 "If you want to use `RoFormerForCausalLM` as a standalone, add `is_decoder=True.`"
12051205 )
12061206
1207- self .roformer = RoFormerModel (config )
1207+ self .roformer = RoFormerModel (config , add_pooling_layer = False )
12081208 self .cls = RoFormerOnlyMLMHead (config )
12091209
12101210 self .init_weights ()
@@ -1388,7 +1388,7 @@ class RoFormerForSequenceClassification(RoFormerPreTrainedModel):
13881388 def __init__ (self , config ):
13891389 super ().__init__ (config )
13901390 self .num_labels = config .num_labels
1391- self .roformer = RoFormerModel (config )
1391+ self .roformer = RoFormerModel (config , add_pooling_layer = False )
13921392 self .classifier = RoFormerClassificationHead (config )
13931393
13941394 self .init_weights ()
@@ -1471,7 +1471,7 @@ class RoFormerForMultipleChoice(RoFormerPreTrainedModel):
14711471 def __init__ (self , config ):
14721472 super ().__init__ (config )
14731473
1474- self .roformer = RoFormerModel (config )
1474+ self .roformer = RoFormerModel (config , add_pooling_layer = False )
14751475 self .sequence_summary = SequenceSummary (config )
14761476 self .classifier = nn .Linear (config .hidden_size , 1 )
14771477
@@ -1577,7 +1577,7 @@ def __init__(self, config):
15771577 super ().__init__ (config )
15781578 self .num_labels = config .num_labels
15791579
1580- self .roformer = RoFormerModel (config )
1580+ self .roformer = RoFormerModel (config , add_pooling_layer = False )
15811581 self .dropout = nn .Dropout (config .hidden_dropout_prob )
15821582 self .classifier = nn .Linear (config .hidden_size , config .num_labels )
15831583
@@ -1671,7 +1671,7 @@ def __init__(self, config):
16711671 config .num_labels = 2
16721672 self .num_labels = config .num_labels
16731673
1674- self .roformer = RoFormerModel (config )
1674+ self .roformer = RoFormerModel (config , add_pooling_layer = False )
16751675 self .qa_outputs = nn .Linear (config .hidden_size , config .num_labels )
16761676
16771677 self .init_weights ()
0 commit comments