ValueError: Connection error, and we cannot find the requested files in the cached path
Author: teamwong111
Pull request: no

### System Info

transformers version: 4.8.1
python version: 3.8
platform: Ubuntu 20.04.1 LTS

### Who can help?

@ArthurZucker, @younesbelkada

### Information

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

### Tasks

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

### Reproduction

Just run the below python script
```
from transformers import BertTokenizerFast
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
```

We can get error messages

```
Traceback (most recent call last):
  File "1.py", line 3, in <module>
    tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
  File "/home/jzwang/miniconda3/envs/torch1.10/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1672, in from_pretrained
    resolved_vocab_files[file_id] = cached_path(
  File "/home/jzwang/miniconda3/envs/torch1.10/lib/python3.8/site-packages/transformers/file_utils.py", line 1329, in cached_path
    output_path = get_from_cache(
  File "/home/jzwang/miniconda3/envs/torch1.10/lib/python3.8/site-packages/transformers/file_utils.py", line 1552, in get_from_cache
    raise ValueError(
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.
```

And I tried to download the file in the terminal using `wget https://huggingface.co/bert-base-uncased/blob/main/vocab.txt` but also failed. I do not know if there are any safety policies to prevent access.

I checked the error code which is 104. I guess maybe some services have malfunctioned.

I think it works well before about 2023-07-26 4:00 P.M.

### Expected behavior

Hope you can give me some advice or fix the bug.

Comments:
Hey! Pretty sure this was just a temporary failure! It is back up for me! 

Thanks for your reply. But the problem still exists for me. 
I debugged the code of Transformers 4.8.1 and found there is an variable called `vocab_files` in PreTrainedTokenizerBase.from_pretrained method.
`vocab_files` contains {'vocab_file': 'https://huggingface.co/bert-base-uncased/resolve/main/vocab.txt', 'tokenizer_file': 'https://huggingface.co/bert-base-uncased/resolve/main/tokenizer.json', 'added_tokens_file': 'https://huggingface.co/bert-base-uncased/resolve/main/added_tokens.json', 'special_tokens_map_file': 'https://huggingface.co/bert-base-uncased/resolve/main/special_tokens_map.json', 'tokenizer_config_file': 'https://huggingface.co/bert-base-uncased/resolve/main/tokenizer_config.json'}. 
But the website `https://huggingface.co/bert-base-uncased/resolve/main/added_tokens.json` and `https://huggingface.co/bert-base-uncased/resolve/main/special_tokens_map.json` show `Entry not found`. I guess it is why the bug appears.

Pretty sure this has been fixed since then, you should consider using a more recent version of Transformers, 4.8.1 is more than 2 years old.

Hi!  I encountered the same problem. When reproducing the code of this paper (https://github.com/rshaojimmy/MultiModal-DeepFake), I used the same version 4.8.1 transformers, and executed this line of code

`tokenizer = BertTokenizerFast.from_pretrained(args.text_encoder)` 

prompts such an error: 

`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 found it has access this link(https://huggingface.co/bert-base-uncased/resolve/main/vocab.txt) but it returns 404
And I upgraded the version of transformers to 4.10.1 and reported this error:

`requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')), '(Request ID: 9709381c-b025-435d-aba5-aef8667c4d1a)')
`

I saw [this blog](https://blog.csdn.net/weixin_43301333/article/details/128080461), I guess it's a network problem

you can just upgrade transformers ..
It works for me.
pip install --upgrade tarnsformers

Thank you for the suggestion, indeed I finally solved this problem by downloading the model locally, doing a local load, using `bert-base-uncased` as an example, downloading the following file in the https://huggingface.co/bert-base-uncased/tree/main:

- config.json
- vocab.txt
- pytorch_model.bin
```
tokenizer = BertTokenizerFast.from_pretrained(args.text_encoder)
```
改为
```
tokenizer = BertTokenizerFastfrom_pretrained("./bert_localpath/")
```
`./bert_localpath/`  is the path where I put the above file.

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.

> ### System Info
> transformers version: 4.8.1 python version: 3.8 platform: Ubuntu 20.04.1 LTS
> 
> ### Who can help?
> @ArthurZucker, @younesbelkada
> 
> ### Information
> * [ ]  The official example scripts
> * [x]  My own modified scripts
> 
> ### Tasks
> * [x]  An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
> * [ ]  My own task or dataset (give details below)
> 
> ### Reproduction
> Just run the below python script
> 
> ```
> from transformers import BertTokenizerFast
> tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
> ```
> 
> We can get error messages
> 
> ```
> Traceback (most recent call last):
>   File "1.py", line 3, in <module>
>     tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
>   File "/home/jzwang/miniconda3/envs/torch1.10/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1672, in from_pretrained
>     resolved_vocab_files[file_id] = cached_path(
>   File "/home/jzwang/miniconda3/envs/torch1.10/lib/python3.8/site-packages/transformers/file_utils.py", line 1329, in cached_path
>     output_path = get_from_cache(
>   File "/home/jzwang/miniconda3/envs/torch1.10/lib/python3.8/site-packages/transformers/file_utils.py", line 1552, in get_from_cache
>     raise ValueError(
> 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.
> ```
> 
> And I tried to download the file in the terminal using `wget https://huggingface.co/bert-base-uncased/blob/main/vocab.txt` but also failed. I do not know if there are any safety policies to prevent access.
> 
> I checked the error code which is 104. I guess maybe some services have malfunctioned.
> 
> I think it works well before about 2023-07-26 4:00 P.M.
> 
> ### Expected behavior
> Hope you can give me some advice or fix the bug.

I encountered this problem in pycharm, but it is runnable in vscode

I added a proxy, but it still has no effect.

> Thank you for the suggestion, indeed I finally solved this problem by downloading the model locally, doing a local load, using `bert-base-uncased` as an example, downloading the following file in the https://huggingface.co/bert-base-uncased/tree/main:
> 
> * config.json
> * vocab.txt
> * pytorch_model.bin
> 
> ```
> tokenizer = BertTokenizerFast.from_pretrained(args.text_encoder)
> ```
> 
> 改为
> 
> ```
> tokenizer = BertTokenizerFastfrom_pretrained("./bert_localpath/")
> ```
> 
> `./bert_localpath/` is the path where I put the above file.

hello，where is this line `BertTokenizerFast.from_pretrained(args.text_encoder)`? I cannot find it in  transformers.