Replacing last layer of a fine-tuned model for using different set of labels
I’m trying to fine-tunedslim/bert-base-NER(any better models?) using thewnut_17dataset.Since the number of NER labels is different, I manually replaced these parameters in the model to get rid of thesize mismatch error:model.config.id2label = my_id2labelmodel.config.label2id = my_label2idmodel.config._num_labels = len(my_id2label) ## replacing 9 by 13However, I now get the following error which I don’t know how to handle:Expected input batch_size (1456) to match target batch_size (1008).Has anyone handled this manually?@sguggerIt will be great if we can have a solid function that handles the head replacements for fine-tuning.tokenized_wnut[‘train’].shape = (3394, 7)tokenized_wnut[‘validation’].shape = (1009, 7)