ReadTimeOutError with from_pretrained for some model checkpoints only
Author: SRGAnalytics-MD
Pull request: no

### System Info

- `transformers` version: 4.40.1
- Platform: Windows-10-10.0.19045-SP0
- Python version: 3.8.13
- Huggingface_hub version: 0.22.2
- Safetensors version: 0.4.3
- Accelerate version: not installed
- Accelerate config: not found
- PyTorch version (GPU?): 2.3.0+cpu (False)
- 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?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

The following code returns `(ReadTimeoutError("HTTPSConnectionPool(host='cdn-lfs.huggingface.co', port=443): Read timed out. (read timeout=10)"), '(Request ID: b3c4325c-3632-4f96-80b7-d132556d0830)')`:

```
from transformers import AutoModelForSequenceClassification
num_labels = 3
model = (AutoModelForSequenceClassification
         .from_pretrained("distilbert/distilbert-base-uncased", num_labels=num_labels, resume_download = True)
         .to("cpu"))
```


However, if instead I use `google-bert/bert-base-uncased` I am able to retrieve the pretrained model successfully.
```
model = (AutoModelForSequenceClassification
         .from_pretrained("google-bert/bert-base-uncased", num_labels=num_labels, resume_download = True)
         .to("cpu"))
```

Just in case it was a proxy issue, I did the following:
```
!pip install  requests==2.27.1 --upgrade
import os
os.environ['CURL_CA_BUNDLE'] = ''
```
but the issue continues, although note that when attempting to retrieve the pretrained model, distilbert gives the following warnings: 
* InsecureRequestWarning: Unverified HTTPS request is being made to host 'huggingface.co'
* InsecureRequestWarning: Unverified HTTPS request is being made to host 'cdn-lfs.huggingface.co'
whereas google-bert only gives the first of these warnings.

As a previous workaround (corresponding to AutoML), I had manually downloaded the distilbert pretrained model from the Model Hub Files and saved to my local drive.  How would one go about downloading the corresponding pretrained model with the sequence classification head (i.e., corresponding to AutoModelForSequenceClassification) from the ModelHub and / or github?

### Expected behavior

I expect no ReadTimeOutError and to be able to retrieve the pretrained model.

Comments:
Hi @SRGAnalytics-MD, thanks for raising this issue! 

We occasionally experience transient issues with hub connections, which normally resolve with a retry. Sometimes it's unfortunately a few minutes before a connection can be made again if there's a more serious outage. 

Do you encounter the connection issue every time you try and download `"distilbert/distilbert-base-uncased"` and never when downloading `"google-bert/bert-base-uncased"`? I'm currently able to download both without issue running on the development branch

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.