How to finetune ELECTRA on glue?
After pretraining my own electra model, I wanted to test it out in Glue using run_glue.py. However I got this:
ValueError: Unrecognized configuration class <class 'transformers.configuration_electra.ElectraConfig'> for this kind of AutoModel: AutoModelForSequenceClassification.
Model type should be one of DistilBertConfig, AlbertConfig, CamembertConfig, XLMRobertaConfig, BartConfig, RobertaConfig, BertConfig, XLNetConfig, FlaubertConfig, XLMConfig.
After taking a look at the source code, It seems like ElectraConfig isn't available for sequence classification, is there a reason for that? Did anyone finetune electra on glue?
I have a pull request here https://github.com/huggingface/transformers/pull/4257
I just cloned your repo an tried to test with my model and it keeps saying the same:

Could you tell me how it's used?
@liuzzi's PR was merged this morning. The ElectraForSequenceClassification model is now available, so you can use it directly in run_glue.py.
Please make sure to pull the latest changes from the repo, or to wait for v2.10 which should be released in a few hours.
awesome, it works perfectly, thank you very much!
@elyesmanai Could you please share the code for pretraining Electra from scratch?
I'm using the simpletransformers library for the pretraining since transformers doesn't support it yet. here's a link to how you can do it, it's super easy. It's built on top of transformers so you can load the model into transformers and use the rest of the lib
The pre-training from scratch for transformers is available here. It is being tested right now.
This problem happened again, when I use ELECTRA on question-answering pipeline. My Transformers version is 2.11.0.
from transformers import pipeline, AutoTokenizer, AutoModelForQuestionAnswering
tokenizer = AutoTokenizer.from_pretrained("ahotrod/electra_large_discriminator_squad2_512")
model = AutoModelForQuestionAnswering.from_pretrained("ahotrod/electra_large_discriminator_squad2_512")
albert_qa = pipeline('question-answering', model=model, tokenizer=tokenizer)
