Update modeling_hf_nomic_bert.py (#17)
Browse files- Update modeling_hf_nomic_bert.py (cf852797dc2bfe30cc870f365a3cae0fa794ec87)
modeling_hf_nomic_bert.py
CHANGED
@@ -1869,7 +1869,7 @@ class NomicBertForMultipleChoice(NomicBertPreTrainedModel):
|
|
1869 |
|
1870 |
self.bert = NomicBertModel(config, add_pooling_layer=True)
|
1871 |
classifier_dropout = (
|
1872 |
-
config
|
1873 |
)
|
1874 |
self.dropout = nn.Dropout(classifier_dropout)
|
1875 |
self.classifier = nn.Linear(config.hidden_size, 1)
|
@@ -1947,7 +1947,7 @@ class NomicBertForTokenClassification(NomicBertPreTrainedModel):
|
|
1947 |
|
1948 |
self.bert = NomicBertModel(config, add_pooling_layer=False)
|
1949 |
classifier_dropout = (
|
1950 |
-
config
|
1951 |
)
|
1952 |
self.dropout = nn.Dropout(classifier_dropout)
|
1953 |
self.classifier = nn.Linear(config.hidden_size, config.num_labels)
|
|
|
1869 |
|
1870 |
self.bert = NomicBertModel(config, add_pooling_layer=True)
|
1871 |
classifier_dropout = (
|
1872 |
+
getattr(config, "classifier_dropout", config.resid_pdrop)
|
1873 |
)
|
1874 |
self.dropout = nn.Dropout(classifier_dropout)
|
1875 |
self.classifier = nn.Linear(config.hidden_size, 1)
|
|
|
1947 |
|
1948 |
self.bert = NomicBertModel(config, add_pooling_layer=False)
|
1949 |
classifier_dropout = (
|
1950 |
+
getattr(config, "classifier_dropout", config.resid_pdrop)
|
1951 |
)
|
1952 |
self.dropout = nn.Dropout(classifier_dropout)
|
1953 |
self.classifier = nn.Linear(config.hidden_size, config.num_labels)
|