Upload Bert style classifier with mean pooling

Hello,

At the moment I uploaded my model as a feature extractor (numind/generic-sentiment-v1), but I would want to also upload it with a classification head to make it a classifier. From my understanding, I would need to upload a model load with AutoModelForSequenceClassification (here, it’s base en e5-base-v2, so it would be BertForSequenceClassification). The issue is BertForSequenceClassification use the CLS token as “pooling”, but e5 (and our fine tune version) has been train using average pooling. Is it possible to change the pooling strategy in BertForSequenceClassification. Or is there other way to do what I want. Thanks !