bug in run_glue.py
Author: keloemma
Pull request: no
Labels: name: wontfix

# 🐛 Bug

## Information

Model I am using (FlauBert ...):

Language I am using the model on (French ...):

The problem arises when using:
* [x] the official example scripts: (give details below)

the script "run_glue" (I did not modified anything) I took it as it is

The tasks I am working on is:
* [x] an official FLUE task: (CLS = classification tast ) :  finetuning model 


## To reproduce

Steps to reproduce the behavior:

1. Just run the script run_glue.py from a bash script following commands in the FlauBert tuto (https://github.com/getalp/Flaubert/tree/master/flue).

config='flue/examples/cls_books_lr5e6_hf_base_cased.cfg'
source $config
python ~/transformers/examples/run_flue.py \
                                        --data_dir $data_dir \
                                        --model_type flaubert \
                                        --model_name_or_path $model_name_or_path \
                                        --task_name $task_name \
                                        --output_dir $output_dir \
                                        --max_seq_length 512 \
                                        --do_train \
                                        --do_eval \
                                        --learning_rate $lr \
                                        --num_train_epochs $epochs \
                                        --save_steps $save_steps \
                                        --fp16 \
                                        --fp16_opt_level O1 \
                                        |& tee output.log

<!-- If you have code snippets, error messages, stack traces please provide them here as well.
     Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
     Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->

`

03/27/2020 11:54:48 - WARNING - main - Process rank: -1, device: cuda, n_gpu: 2, distributed training: False, 16-bits training: True
Traceback (most recent call last):
File "/home/getalp/kelodjoe/transformers/examples/run_glue.py", line 693, in
main()
File "/home/getalp/kelodjoe/transformers/examples/run_glue.py", line 613, in main
config_class, model_class, tokenizer_class = MODEL_CLASSES[args.model_type]
KeyError: 'flaubert'

`

Code of line 613   

`


    # Training
    if args.do_train:
        train_dataset = load_and_cache_examples(args, args.task_name, tokenizer, evaluate=False)
        global_step, tr_loss = train(args, train_dataset, model, tokenizer)
        logger.info(" global_step = %s, average loss = %s", global_step, tr_loss)

    # Saving best-practices: if you use defaults names for the model, you can reload it using from_pretrained()  #613
    if args.do_train and (args.local_rank == -1 or torch.distributed.get_rank() == 0):
        # Create output directory if needed
        if not os.path.exists(args.output_dir) and args.local_rank in [-1, 0]:
            os.makedirs(args.output_dir)

        logger.info("Saving model checkpoint to %s", args.output_dir)
        # Save a trained model, configuration and tokenizer using `save_pretrained()`.
        # They can then be reloaded using `from_pretrained()`
        model_to_save = (
            model.module if hasattr(model, "module") else model
        )  # Take care of distributed/parallel training
        model_to_save.save_pretrained(args.output_dir)
        tokenizer.save_pretrained(args.output_dir)
`

## Expected behavior

<!-- A clear and concise description of what you would expect to happen. -->

I would Have expected it to work. and train the model.

## Environment info
<!-- You can run the command `python transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->
     
- `transformers` version:   => how do I know I git pull before running the script
- Platform: linux
- Python version: 3.6
- PyTorch version (GPU?): 1.4
- Tensorflow version (GPU?):
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: no


Comments:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.