[Bug] Issue in AutoModelForSequenceClassification while initialization
## Issue:

If we import Sequence Classification model like this,

```python
from transformers import AutoModelForSequenceClassification
num_labels=28
model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", 
                                                            num_labels=num_labels, 
                                                            problem_type='multi_label_classification',
                                                            label2id=label2id,
                                                            id2label=id2label)
```
it will always generate a classification head like this
```
  (classifier): Linear(in_features=768, out_features=1, bias=True)
```
Ideally `out_features` should be like same as `num_labels` specified. Like this
```
  (classifier): Linear(in_features=768, out_features=28, bias=True)
```
for `single_label_classification` also the same thing is happening. 

If we remove below two lines while initialization it works fine. 
```python
label2id=label2id,
id2label=id2label
```
Note: I have initialized `label2id` and `id2label` are assigned respective values properly. It can be found in below colab notebook 
## Environment info

- `transformers` version: 4.12
- Platform: colab

### Who can help
 @LysandreJik  

## To reproduce
[colab](https://github.com/bhadreshpsavani/UnderstandingNLP/blob/master/ErrorWhileImportingMultilabelClassifier.ipynb)


A couple of things are strange in your code cell # 3:

```python


id2label = { "0": "admiration", "1": "amusement", "2": "anger", "3": "annoyance", "4": "approval", "5": "caring", "6": "confusion", "7": "curiosity", "8": "desire",
    "9": "disappointment", "10": "disapproval", "11": "disgust", "12": "embarrassment", "13": "excitement", "14": "fear", "15": "gratitude", "16": "grief",
    "17": "joy", "18": "love", "19": "nervousness", "20": "optimism", "21": "pride", "22": "realization", "23": "relief", "24": "remorse", "25": "sadness",
    "26": "surprise", "27": "neutral"
  },
label2id ={ "admiration": 0, "amusement": 1, "anger": 2, "annoyance": 3, "approval": 4, "caring": 5, "confusion": 6, "curiosity": 7, "desire": 8, "disappointment": 9,
    "disapproval": 10, "disgust": 11, "embarrassment": 12, "excitement": 13, "fear": 14, "gratitude": 15, "grief": 16, "joy": 17, "love": 18, "nervousness": 19,
    "neutral": 27, "optimism": 20, "pride": 21, "realization": 22, "relief": 23, "remorse": 24, "sadness": 25, "surprise": 26
  }
num_labels=28
```

The datatype is not consistent. `id2label` has strings and `label2id` has integers (both should be integers). More importantly there is a strange `,` making `id2label` actually a tuple. This is where the bug comes from and by that I mean bug in your code. The library works fine. Remove the comma and you get `out_features=28`.<|||||>Hi @shabie,
Thanks for your help,
the comma doesn't make it a tuple, it is still a dictionary that can be assigned for JSON file variable.
Can you please share your code that might work directly, I tried above suggestion its not working.<|||||>So here's the code you can use:

```python
from transformers import AutoModelForSequenceClassification

labels = [
  'admiration',
  'amusement',
  'anger',
  'annoyance',
  'approval',
  'caring',
  'confusion',
  'curiosity',
  'desire',
  'disappointment',
  'disapproval',
  'disgust',
  'embarrassment',
  'excitement',
  'fear',
  'gratitude',
  'grief',
  'joy',
  'love',
  'nervousness',
  'neutral',
  'optimism',
  'pride',
  'realization',
  'relief',
  'remorse',
  'sadness',
  'surprise',
]

label2id = {k: i for i, k in enumerate(labels)}
id2label = {i: k for i, k in enumerate(labels)}
num_labels = len(labels)

model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", 
                                                            num_labels=num_labels, 
                                                            problem_type='multi_label_classification',
                                                            label2id=label2id,
                                                            id2label=id2label)
print(model.classifier)
# Linear(in_features=768, out_features=28, bias=True)
```<|||||>Thanks @shabie for your help,
This worked!