Error while importing pretrained model
### System Info

- `transformers` version: 4.23.1
- Platform: Windows-10-10.0.22621-SP0
- Python version: 3.10.6
- Huggingface_hub version: 0.10.1
- PyTorch version (GPU?): 1.13.0 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No

### Who can help?

@patil-suraj @patrickvonplaten @LysandreJik 

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [x] My own task or dataset (give details below)

### Reproduction

```
from transformers import AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained("gpt2", num_labels=2)
```
The above code, on execution, returns
```
RuntimeError: Failed to import transformers.models.gpt2.modeling_gpt2 because of the following error (look up to see its traceback):
name '_C' is not defined
```

This error is not specific to that model or to two labels. I ran the example code snippet given at https://huggingface.co/docs/transformers/training#train-with-pytorch-trainer. The same error is presented, albeit with a different model name.

### Expected behavior

From the tutorial, I was expecting a pretrained model object to be initialized, so that I could proceed with fine-tuning it.
Hi @orectique. Have you tried to do something like the following:
https://discuss.pytorch.org/t/nameerror-name-c-is-not-defined-while-importing-torch/124721/2 
or
https://github.com/pytorch/pytorch/issues/1633#issuecomment-323435572<|||||>Thank you, @atturaioe. I explored both of those forums and tried the strategies. However, the error seems to have been something else. Anywho, in exasperation, I dumped the entire environment I was using and installed all the packages from scratch. That seems to have done it. 