Thanks, but i don’t know how should i use this and where should i call it. i don’t know what kind of classifiers can i use instead of default linear classifier and how to implement? this is a part of my code:
max_length = 50
tokenizer = BartTokenizer.from_pretrained('facebook/bart-large', do_lower_case=True)
encodings = tokenizer.batch_encode_plus(comments,max_length=max_length,padding='max_length', truncation=True)
train_inputs = encodings['input_ids']
train_masks = encodings['attention_mask']
batch_size = 48
train_data = TensorDataset(train_inputs, train_masks, train_labels)
train_sampler = RandomSampler(train_data)
train_dataloader = DataLoader(train_data, sampler=train_sampler, batch_size=batch_size)
model = BartForSequenceClassification.from_pretrained('facebook/bart-large', num_labels=num_labels)
model.cuda()

and after this, i go for the train part.