Fill-Mask
Transformers
PyTorch
Safetensors
English
nomic_bert
custom_code
zpn commited on
Commit
52489df
1 Parent(s): 4a73da5

Update modeling_hf_nomic_bert.py (#17)

Browse files

- Update modeling_hf_nomic_bert.py (cf852797dc2bfe30cc870f365a3cae0fa794ec87)

Files changed (1) hide show
  1. modeling_hf_nomic_bert.py +2 -2
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.classifier_dropout if config.classifier_dropout is not None else config.hidden_dropout_prob
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.classifier_dropout if config.classifier_dropout is not None else config.hidden_dropout_prob
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)