How can we finetune this model for multiclass classification?

#7
by piyushkumarsoni - opened

I am getting error when executing the following statement- model = TFDistilBertForSequenceClassification.from_pretrained('distilbert-base-uncased-finetuned-sst-2-english', num_labels=5). When num_labels is specified as 2, it is working fine.

https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english mentions
"This model is a fine-tune checkpoint of DistilBERT-base-uncased, fine-tuned on SST-2. "

If you want to create multi-class classifier with 5 class, you can fine-tune distilbert-base-uncased model.
Have a look at the Hugging Face course's page: Fine-tuning a model with the Trainer API (https://huggingface.co/course/chapter3/3?fw=pt) on how to fine-tune your distilbert-base-uncased model to make it a classifier model.

Sign up or log in to comment