Closed pratikchhapolika closed 3 years ago
The model weights include a classifier layer with three labels. That is why you get an error. You need to replace that last layer.
You should probably do something like the following:
finbert_without_classifier_head = AutoModel.from_pretrained("/home/pratik/finbert")
finbert_without_classifier_head.save_pretrained("/home/pratik/finbert_wch")
finbert_twoforty = AutoModelForSequenceClassification.from_pretrained("/home/pratik/finbert_wch", num_labels = 240)
I have label of dimension
240
, it ismulti label
classification problem.I downloaded the Finbert model:
This gives me error: