Multiclass Classification: "labels" format

Hello Community,

I fine-tuned a BERTforSequenceClassification with the Huggingface Trainer
i have a question regarding the format of the “labels” in my dataset. I read through a lot of postings and threads, but i am still a bit confused.

I have a dataset with 5 labels and it is a multiclass classification problem. So a text has exact one value of (0,1,2,3,4). I read everywhere that the format has to be a tensor with 0’s and 1’s. However, i finetuned a BERT model with the Huggingface Trainer and let the labels have the values from 0 to 4.

My Question:

does the trainer autoformat these labels or does it accept normal integers aswell? I dont get any error, can predict values without problems. The results seem reliable aswell.

I hope you can help me with this, because i didnt find a reliable source anywhere that confirms this.
Thank you very much :slight_smile: