In version v3.x:
bash
model = BertModel.from_pretrained("bert-base-cased")
outputs = model(**inputs)
to obtain the same in version v4.x:
bash
model = BertModel.from_pretrained("bert-base-cased")
outputs = model(**inputs, return_dict=False)
or
bash
model = BertModel.from_pretrained("bert-base-cased", return_dict=False)
outputs = model(**inputs)
5. Removed some deprecated attributes
Attributes that were deprecated have been removed if they had been deprecated for at least a month. The full list of deprecated attributes can be found in #8604.
Here is a list of these attributes/methods/arguments and what their replacements should be:
In several models, the labels become consistent with the other models:
- masked_lm_labels becomes labels in AlbertForMaskedLM and AlbertForPreTraining.
- masked_lm_labels becomes labels in BertForMaskedLM and BertForPreTraining.
