Fill-Mask
Transformers
PyTorch
Safetensors
English
nomic_bert
custom_code
zpn commited on
Commit
b7537ce
1 Parent(s): a6a8312

Update modeling_hf_nomic_bert.py

Browse files
Files changed (1) hide show
  1. modeling_hf_nomic_bert.py +1 -1
modeling_hf_nomic_bert.py CHANGED
@@ -396,7 +396,7 @@ class NomicBertPreTrainedModel(PreTrainedModel):
396
  if config is None:
397
  config = cls.config_class.from_pretrained(model_name)
398
  remove_cls = cls != NomicBertForPreTraining
399
- remove_bert_prefix = cls != NomicBertForPreTraining and cls != NomicBertForSequenceClassification
400
  ignore_mismatched_shapes = kwargs.pop("ignore_mismatched_sizes", False)
401
  num_labels = kwargs.pop("num_labels", None)
402
  rotary_scaling_factor = kwargs.pop("rotary_scaling_factor", None)
 
396
  if config is None:
397
  config = cls.config_class.from_pretrained(model_name)
398
  remove_cls = cls != NomicBertForPreTraining
399
+ remove_bert_prefix = cls not in [NomicBertForPreTraining, NomicBertForSequenceClassification, NomicBertForTokenClassification, NomicBertForMultipleChoice, NomicBertForQuestionAnswering]
400
  ignore_mismatched_shapes = kwargs.pop("ignore_mismatched_sizes", False)
401
  num_labels = kwargs.pop("num_labels", None)
402
  rotary_scaling_factor = kwargs.pop("rotary_scaling_factor", None)