Closed JAYANTH-MOHAN closed 8 months ago
Thanks for raising this issue.
From the error message, it appears that the state dictionary from the Hugging Face model may have one key less than the custom model's state dictionary.
Could you confirm the version of the transformers
library you're using? If not already, I recommend trying with transformers==4.28.1
.
For reference, the specific package versions used can be found at notebooks/requirements/requirements_fine_tuning.txt
.
Thanks, it works now!
In this code cell :
tokenizer_base = BertTokenizer.from_pretrained('bert-base-uncased') bert_base = MyBertForSequenceClassification.from_pretrained( model_type='bert-base-uncased', config_args={"vocab_size": 30522, "n_classes": 2} # these are default configs but just added for explicity )
i am getting this error : AssertionError: mismatched keys: 201 != 202