I’m using  BertForSequenceClassifcation  by huggingface for multi-class classification over 50 classes.
When I try to train my model, I get the runtime error precisely at the line indicated below:
model = BertForSequenceClassification.from_pretrained(
    "bert-base-uncased",
    num_labels = 50, 
    output_attentions = False, 
    output_hidden_states = False, 
)

for step, batch in enumerate(train_dataloader):

        b_texts = batch[0].to(device)
        b_attention_masks = batch[1].to(device)
        b_authors = batch[2].to(device)

        model.zero_grad()        

        outputs = model(b_texts, 
                        token_type_ids=None, 
                        attention_mask=b_attention_masks, 
                        labels=b_authors)  <---- ERROR HERE