Erroneous 404 warning when using AutoTokenizer.from_pretrained
Author: TevenLeScao
Pull request: no
Labels: name: Good First Issue

## Environment info

- `transformers` version: 4.12.5
- Platform: Linux-5.11.0-41-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyTorch version (GPU?): 1.9.0+cu111 (True)
- Tensorflow version (GPU?): 2.6.0 (False)
- Flax version (CPU?/GPU?/TPU?): 0.3.6 (cpu)
- Jax version: 0.2.24
- JaxLib version: 0.1.73
- Using GPU in script?: no
- Using distributed or parallel set-up in script?: no

### Who can help
@LysandreJik 

## Information

Model I am using (Bert, XLNet ...): any model

The problem arises when using:
* [ ] the official example scripts: (give details below)
* [ x] my own modified scripts: (give details below)

## To reproduce

Steps to reproduce the behavior:

`tokenizer = transformers.AutoTokenizer.from_pretrained("bigscience/tr3m-1B3-pile-checkpoints", revision="global_step1500")`

An erroneous warning is displayed: `404 Client Error: Not Found for url: https://huggingface.co/bigscience/tr3m-1B3-pile-checkpoints/resolve/main/config.json`, hinting that the AutoTokenizer is looking in the wrong place (the master branch), ignoring the revision argument, and not finding the file. However, the tokenizer is correctly initialized.

## Expected behavior

No warning.

Comments:
Seems to be working fine for me

```
Python 3.7.13 (default, Mar 28 2022, 07:24:34) 
[Clang 12.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import transformers
>>> tokenizer = transformers.AutoTokenizer.from_pretrained("bigscience/tr3m-1B3-pile-checkpoints", revision="global_step1500")
Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.74k/1.74k [00:00<00:00, 847kB/s]
Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.29M/1.29M [00:01<00:00, 944kB/s]
>>> transformers.__version__
'4.18.0.dev0'

```

Seems like the erroneous warning was redundant and removed since 0f71c2905 commit

```bash
Author: lewtun <lewis.c.tunstall@gmail.com>
Date:   Mon Feb 14 18:03:07 2022 +0100

    Remove redundant error logging in from_pretrained() method (#15631)
    
    * Remove error logging in from_pretrained() method
```

### bisect log (old -> the error msg displayed, new -> the error msg not displayed)
```bash
git bisect start
# old: [ef3cec0ca577e5950e42e8de1a2991b5dc85dfa6] Release: v4.12.5
git bisect old ef3cec0ca577e5950e42e8de1a2991b5dc85dfa6
# new: [31ec2cb2newfbdd4c1ac9c6c9b8a74e974984206] Release: v4.18.0
git bisect new 31ec2cb2newfbdd4c1ac9c6c9b8a74e974984206
# old: [62bf536631d22e28aaac4d19c4d0d901ebf015ad] Release v4.12.0
git bisect old 62bf536631d22e28aaac4d19c4d0d901ebf015ad
# old: [3385ca2582f47239efbc7fc45b044d02ff60f736] Change REALM checkpoint to new ones (#15439)
git bisect old 3385ca2582f47239efbc7fc45b044d02ff60f736
# new: [b7018abf3ce34ed9e2d7dddb5fcf3a2af27a37f8] TF: Unpack model inputs through a decorator  (#15907)
git bisect new b7018abf3ce34ed9e2d7dddb5fcf3a2af27a37f8
# new: [3de12906c8e5e27b2216642f0496a3efda8c4edd] fix: hfdeepspeed config argument (#15711)
git bisect new 3de12906c8e5e27b2216642f0496a3efda8c4edd
# old: [eed3186b79d7ef9187113849f9ee7882bdd359fd] Trigger doc build
git bisect old eed3186b79d7ef9187113849f9ee7882bdd359fd
# new: [9eb7e9ba1d132eec947e95988f90ddc41e3bb65d] Fix ASR pipelines from local directories with wav2vec models that have language models attached (#15590)
git bisect new 9eb7e9ba1d132eec947e95988f90ddc41e3bb65d
# old: [8c03df101064f70e301dce54f76a9cb1f8e392aa] Rebase (#15606)
git bisect old 8c03df101064f70e301dce54f76a9cb1f8e392aa
# old: [2b8599b2df6a09f83bd8b19086f691a648af74cb] Fix a bug that ignores max_seq_len in preprocess (#15238)
git bisect old 2b8599b2df6a09f83bd8b19086f691a648af74cb
# new: [e314c19a3ff52b39f33453ab6c7f7b3c6c12413e] fix bug for the log of  RNG states are not properly loaded  exception. (#15638)
git bisect new e314c19a3ff52b39f33453ab6c7f7b3c6c12413e
# old: [b090b790228bbe420f1667f8b0335c8b8e5bb5eb] Make Swin work with VisionEncoderDecoderModel (#15527)
git bisect old b090b790228bbe420f1667f8b0335c8b8e5bb5eb
# new: [2e11a043374a6229ec129a4765ee4ba7517832b9] Register feature extractor (#15634)
git bisect new 2e11a043374a6229ec129a4765ee4ba7517832b9
# new: [0f71c290535672d7b0eff5858a3dc3d7bd07a983] Remove redundant error logging in from_pretrained() method (#15631)
git bisect new 0f71c290535672d7b0eff5858a3dc3d7bd07a983
# first new commit: [0f71c290535672d7b0eff5858a3dc3d7bd07a983] Remove redundant error logging in from_pretrained() method (#15631)
```

If you set logging level to DEBUG like below 
```python
import transformers
import logging
logging.basicConfig(level=logging.DEBUG)
tokenizer = transformers.AutoTokenizer.from_pretrained("bigscience/tr3m-1B3-pile-checkpoints", revision="global_step1500")
```

since 0f71c290535672d7b0eff5858a3dc3d7bd07a983 commit (v4.16.0) will give
```bash
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/tokenizer_config.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/config.json HTTP/1.1" 200 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/tokenizer_config.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/vocab.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/merges.txt HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/tokenizer.json HTTP/1.1" 200 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/added_tokens.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/special_tokens_map.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/tokenizer_config.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/main/config.json HTTP/1.1" 404 0

```

but the previous versions give 
```bash
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/tokenizer_config.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/config.json HTTP/1.1" 200 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/tokenizer_config.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/vocab.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/merges.txt HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/tokenizer.json HTTP/1.1" 200 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/added_tokens.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/special_tokens_map.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/tokenizer_config.json HTTP/1.1" 404 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /bigscience/tr3m-1B3-pile-checkpoints/resolve/main/config.json HTTP/1.1" 404 0
404 Client Error: Entry Not Found for url: https://huggingface.co/bigscience/tr3m-1B3-pile-checkpoints/resolve/main/config.json
```
but HTTPS connection to **/bigscience/tr3m-1B3-pile-checkpoints/resolve/global_step1500/config.json** was already successful according to the logging messages.



@TevenLeScao guess this can be closed then