Labels are now added to model config under id2label and label2id
Fixes huggingface/transformers#2487
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/2945?src=pr&el=h1) Report
> Merging [#2945](https://codecov.io/gh/huggingface/transformers/pull/2945?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/53ce3854a16ad2a715bc6ac8af3e30c18b5a1d11?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/2945/graphs/tree.svg?width=650&token=9qOlN6Hb1c&height=150&src=pr)](https://codecov.io/gh/huggingface/transformers/pull/2945?src=pr&el=tree)

```diff
@@          Coverage Diff           @@
##           master   #2945   +/-   ##
======================================
  Coverage    76.1%   76.1%           
======================================
  Files          98      98           
  Lines       15946   15946           
======================================
  Hits        12136   12136           
  Misses       3810    3810
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/2945?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/2945?src=pr&el=footer). Last update [53ce385...0a5ab3f](https://codecov.io/gh/huggingface/transformers/pull/2945?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
<|||||>I had noticed this indeed, thanks for fixing!<|||||>@marma So the labels are supposed to be the actual labels instead of placeholders like "Label_0", "Label_1" ... right? I tried it out in 3.3.1 but it still generates the placeholder labels in config. I guess I am missing something? I would be grateful if you could help! :) 

<|||||>I would also be interested in learning how I can store the actual label2id and id2label dictionaries along with a pre-trained model. Is this possible?<|||||>@konstantinmiller & @naveenjafer You can pass label2id and id2label to config then pass that config to model like in below snippet:
```py
config = AutoConfig.from_pretrained(
        model_args.config_name if model_args.config_name else model_args.model_name_or_path,
        num_labels=num_labels,
        id2label={i: label for i, label in enumerate(label_list)},
        label2id={label: i for i, label in enumerate(label_list)},
        finetuning_task=data_args.task_name)
model = AutoModelForSequenceClassification.from_pretrained(
        model_args.model_name_or_path,
        from_tf=bool(".ckpt" in model_args.model_name_or_path),
        config=config )
```