I am using AutoTrain Advanced and selected Task as Text Classification and Base Model as achimoraites/roberta-base_ag_news. My uploaded file(.csv) have 11 class labels in target column. But my based model has only 4 class labels. When I start training in huggingface space, I am getting below error.
RuntimeError: Error(s) in loading state_dict for RobertaForSequenceClassification:
size mismatch for classifier.out_proj.weight: copying a param with shape torch.Size([4, 768]) from checkpoint, the shape in current model is torch.Size([11, 768]).
size mismatch for classifier.out_proj.bias: copying a param with shape torch.Size([4]) from checkpoint, the shape in current model is torch.Size([11]).
You may consider adding ignore_mismatched_sizes=True
in the model from_pretrained
method.
AutoTrain advanced I am using to train & create my own model without using any code. But based on this error, I have to add ignore_mismatched_sizes=True somewhere. Where I can add this and how can I resolve this issue.
Also, suggest me on what basis we can select the base model and I couldn’t found any documentation or information regarding AutoTrain Advanced even though not much information in huggingface documentation. Could you please provide the details where I can get AutoTrain Advanced documentation to train & create my own models.