Loss error for bert token classifier

The problem seems to be in the Trainer. How is your data encoded ? can you show the shape, type ans how it looks before passing to the trainer ?

your num_lables = 1 , Are you doing single classification ?