Trainer.__init__() got an unexpected keyword argument 'model'

I followed these instructions for fine-tuning model, and everything works nicely since I got these problems. I am using Google Colab for fine-tuning.

image

It’s strange since the Trainer can not recognize the model. I have already tried using BertForSequenceClassification and AutoModelForSequenceClassification but the results are the same.

Is there any way to fix this?
By the way, I install libraries following the above link.

The problem is solved. Indeed, I used Pytorch Lightning and HuggingFace in parallel. It may be some conflicts between Trainer of hugging-face and pytorch_lightning. After I’ve removed libraries related to pytorch_lightning, the code runs smoothly.