tokenizer = AutoTokenizer.from_pretrained('distilroberta-base') report error
Author: monetjoe
Pull request: no

### System Info

OSError
Can't load tokenizer for 'distilroberta-base'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'distilroberta-base' is the correct path to a directory containing all relevant files for a RobertaTokenizerFast tokenizer.

### 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

Run a Python script with the following code:
tokenizer = AutoTokenizer.from_pretrained('distilroberta-base')

when the program runs at that line, it will report an OS ERR:
OSError
Can't load tokenizer for 'distilroberta-base'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'distilroberta-base' is the correct path to a directory containing all relevant files for a RobertaTokenizerFast tokenizer.

actually the model 'distilroberta-base' is an official model instead of a model from a hf user, its link is 'https://huggingface.co/distilroberta-base' without 'models' path

how could us deal with this problem?

### Expected behavior

let the program could run pass the following code correctly:
tokenizer = AutoTokenizer.from_pretrained('distilroberta-base')  

better works with a cache_dir as follow:
tokenizer = AutoTokenizer.from_pretrained('distilroberta-base', cache_dir='./')  

the model could auto downloaded into my project path without any error.

it is really inconvenient for us to use, if we use default download mode(from_pretrained without args), it will download into C disk on windows, 
if we assign a cache_dir, it will also report error. Even if we try to override the from_pretrained func to use tqdm to download the model into assigned path, it will still report error at request line like: ('Connection aborted.', ConnectionResetError(10054,

Comments:
Please follow the template when reporting issue: share your system info with us. You can run the command `transformers-cli env` and copy-paste its output below.

However, I have tried `tokenizer = AutoTokenizer.from_pretrained('distilroberta-base')` and it works perfectly (for me).

Could you also check with other model checkpoints on the Hub?

I have tried it and it also works for me just fine

> Please follow the template when reporting issue: share your system info with us. You can run the command `transformers-cli env` and copy-paste its output below.

Traceback (most recent call last):
  File "***\.conda\envs\tfui\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "***\.conda\envs\tfui\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "***\.conda\envs\tfui\Scripts\transformers-cli.exe\__main__.py", line 4, in <module>
  File "***\.conda\envs\tfui\lib\site-packages\transformers\commands\transformers_cli.py", line 26, in <module>  
    from .user import UserCommands
  File "***\.conda\envs\tfui\lib\site-packages\transformers\commands\user.py", line 20, in <module>
    from huggingface_hub.hf_api import HfFolder, create_repo, login, logout, whoami
ImportError: cannot import name 'login' from 'huggingface_hub.hf_api' (***\.conda\envs\tfui\lib\site-packages\huggingface_hub\hf_api.py)

ValueError
Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.

I guess it is mostly because of the GFW

Maybe first try to upgrade `huggingface_hub` version

> Maybe first try to upgrade `huggingface_hub` version

OSError
We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like distilroberta-base is not the path to a directory containing a file named config.json.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
huggingface_hub.utils._errors.LocalEntryNotFoundError: Connection error, and we cannot find the requested files in the disk cache. Please try again or make sure your Internet connection is on.

I have upgraded it to 0.15.1, but it still has error

Could you check if this is only for `distilroberta-base` or same error for other checkpoint like `gpt2` or `bert-base-uncased`.

Could you re-run `transformers-cli env`?

> Could you check if this is only for `distilroberta-base` or same error for other checkpoint like `gpt2` or `bert-base-uncased`.
> 
> Could you re-run `transformers-cli env`?

OSError
We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like gpt2 is not the path to a directory containing a file named config.json.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
huggingface_hub.utils._errors.LocalEntryNotFoundError: Connection error, and we cannot find the requested files in the disk cache. Please try again or make sure your Internet connection is on.

//=================================================

Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.

- `transformers` version: 4.30.1
- Platform: Windows-10-10.0.19045-SP0
- Python version: 3.8.16
- Huggingface_hub version: 0.15.1
- Safetensors version: 0.3.1 but is ignored because of PyTorch version too old.
- PyTorch version (GPU?): 1.9.1+cu111 (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?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>

Can't really know what happens in your environment. Probably try with a clean (new) virtual python environment, and install `transformers` as `pip install transformers[dev]`. If still not working, there is nothing we can't help: it's likely your env. connection issue.

I created a totally new env and installed transformers 4.30.2 (latest ver). When I run the code below:
tokenizer = AutoTokenizer.from_pretrained(xxx)
it returns following error:

Failed to import transformers.convert_graph_to_onnx because of the following error (look up to see its traceback):
DLL load failed while importing _imaging:

For Chinese people, it will happen if you don't equipe yourself with a ladder to cross the GFW.

You need proxy.
```
from transformers import AutoTokenizer

proxies = {
    "http": "http://127.0.0.1:7890",
    "https": "http://127.0.0.1:7890"
}

tokenizer = AutoTokenizer.from_pretrained('your_model', proxies=proxies)
```