[bart] fix config.classif_dropout (#7593)
This commit is contained in:
@@ -1658,7 +1658,7 @@
|
|||||||
" 'add_final_layer_norm': False,\n",
|
" 'add_final_layer_norm': False,\n",
|
||||||
" 'attention_dropout': 0.0,\n",
|
" 'attention_dropout': 0.0,\n",
|
||||||
" 'bos_token_id': 0,\n",
|
" 'bos_token_id': 0,\n",
|
||||||
" 'classif_dropout': 0.0,\n",
|
" 'classifier_dropout': 0.0,\n",
|
||||||
" 'd_model': 1024,\n",
|
" 'd_model': 1024,\n",
|
||||||
" 'decoder_attention_heads': 16,\n",
|
" 'decoder_attention_heads': 16,\n",
|
||||||
" 'decoder_ffn_dim': 4096,\n",
|
" 'decoder_ffn_dim': 4096,\n",
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class BartConfig(PretrainedConfig):
|
|||||||
self.dropout = dropout
|
self.dropout = dropout
|
||||||
|
|
||||||
# Classifier stuff
|
# Classifier stuff
|
||||||
self.classif_dropout = classifier_dropout
|
self.classifier_dropout = classifier_dropout
|
||||||
|
|
||||||
# pos embedding offset
|
# pos embedding offset
|
||||||
self.extra_pos_embeddings = self.pad_token_id + 1
|
self.extra_pos_embeddings = self.pad_token_id + 1
|
||||||
|
|||||||
@@ -1176,7 +1176,7 @@ class BartForSequenceClassification(PretrainedBartModel):
|
|||||||
config.d_model,
|
config.d_model,
|
||||||
config.d_model,
|
config.d_model,
|
||||||
config.num_labels,
|
config.num_labels,
|
||||||
config.classif_dropout,
|
config.classifier_dropout,
|
||||||
)
|
)
|
||||||
self.model._init_weights(self.classification_head.dense)
|
self.model._init_weights(self.classification_head.dense)
|
||||||
self.model._init_weights(self.classification_head.out_proj)
|
self.model._init_weights(self.classification_head.out_proj)
|
||||||
|
|||||||
Reference in New Issue
Block a user