Invalid header value when loading "bert-base-uncased"
### System Info

Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.

- `transformers` version: 4.26.1
- Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.31
- Python version: 3.10.9
- Huggingface_hub version: 0.12.1
- PyTorch version (GPU?): 1.13.1+cu117 (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>

### Who can help?

@ArthurZucker

### Information

- [X] The official example scripts
- [ ] 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

```python
Python 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.10.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from transformers import AutoTokenizer
In [2]: tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[2], line 1
----> 1 tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")

File ~/miniconda3/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py:598, in AutoTokenizer.from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
    595     return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
    597 # Next, let's try to use the tokenizer_config file to get the tokenizer class.
--> 598 tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
    599 if "_commit_hash" in tokenizer_config:
    600     kwargs["_commit_hash"] = tokenizer_config["_commit_hash"]

File ~/miniconda3/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py:442, in get_tokenizer_config(pretrained_model_name_or_path, cache_dir, force_download, resume_download, proxies, use_auth_token, revision, local_files_only, subfolder, **kwargs)
    380 """
    381 Loads the tokenizer configuration from a pretrained model tokenizer configuration.
    382
   (...)
    439 tokenizer_config = get_tokenizer_config("tokenizer-test")
    440 ```"""
    441 commit_hash = kwargs.get("_commit_hash", None)
--> 442 resolved_config_file = cached_file(
    443     pretrained_model_name_or_path,
    444     TOKENIZER_CONFIG_FILE,
    445     cache_dir=cache_dir,
    446     force_download=force_download,
    447     resume_download=resume_download,
    448     proxies=proxies,
    449     use_auth_token=use_auth_token,
    450     revision=revision,
    451     local_files_only=local_files_only,
    452     subfolder=subfolder,
    453     _raise_exceptions_for_missing_entries=False,
    454     _raise_exceptions_for_connection_errors=False,
    455     _commit_hash=commit_hash,
    456 )
    457 if resolved_config_file is None:
    458     logger.info("Could not locate the tokenizer configuration file, will try to use the model config instead.")

File ~/miniconda3/lib/python3.10/site-packages/transformers/utils/hub.py:409, in cached_file(path_or_repo_id, filename, cache_dir, force_download, resume_download, proxies, use_auth_token, revision, local_files_only, subfolder, user_agent, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash)
    406 user_agent = http_user_agent(user_agent)
    407 try:
    408     # Load from URL or cache if already cached
--> 409     resolved_file = hf_hub_download(
    410         path_or_repo_id,
    411         filename,
    412         subfolder=None if len(subfolder) == 0 else subfolder,
    413         revision=revision,
    414         cache_dir=cache_dir,
    415         user_agent=user_agent,
    416         force_download=force_download,
    417         proxies=proxies,
    418         resume_download=resume_download,
    419         use_auth_token=use_auth_token,
    420         local_files_only=local_files_only,
    421     )
    423 except RepositoryNotFoundError:
    424     raise EnvironmentError(
    425         f"{path_or_repo_id} is not a local folder and is not a valid model identifier "
    426         "listed on 'https://huggingface.co/models'\nIf this is a private repository, make sure to "
    427         "pass a token having permission to this repo with `use_auth_token` or log in with "
    428         "`huggingface-cli login` and pass `use_auth_token=True`."
    429     )

File ~/miniconda3/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py:124, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
    119 if check_use_auth_token:
    120     kwargs = smoothly_deprecate_use_auth_token(
    121         fn_name=fn.__name__, has_token=has_token, kwargs=kwargs
    122     )
--> 124 return fn(*args, **kwargs)

File ~/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py:1106, in hf_hub_download(repo_id, filename, subfolder, repo_type, revision, library_name, library_version, cache_dir, user_agent, force_download, force_filename, proxies, etag_timeout, resume_download, token, local_files_only, legacy_cache_layout)
   1104 try:
   1105     try:
-> 1106         metadata = get_hf_file_metadata(
   1107             url=url,
   1108             token=token,
   1109             proxies=proxies,
   1110             timeout=etag_timeout,
   1111         )
   1112     except EntryNotFoundError as http_error:
   1113         # Cache the non-existence of the file and raise
   1114         commit_hash = http_error.response.headers.get(
   1115             HUGGINGFACE_HEADER_X_REPO_COMMIT
   1116         )

File ~/miniconda3/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py:124, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
    119 if check_use_auth_token:
    120     kwargs = smoothly_deprecate_use_auth_token(
    121         fn_name=fn.__name__, has_token=has_token, kwargs=kwargs
    122     )
--> 124 return fn(*args, **kwargs)

File ~/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py:1432, in get_hf_file_metadata(url, token, proxies, timeout)
   1429 headers = build_hf_headers(token=token)
   1431 # Retrieve metadata
-> 1432 r = _request_wrapper(
   1433     method="HEAD",
   1434     url=url,
   1435     headers=headers,
   1436     allow_redirects=False,
   1437     follow_relative_redirects=True,
   1438     proxies=proxies,
   1439     timeout=timeout,
   1440 )
   1441 hf_raise_for_status(r)
   1443 # Return

File ~/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py:405, in _request_wrapper(method, url, max_retries, base_wait_time, max_wait_time, timeout, follow_relative_redirects, **params)
    403 # 2. Force relative redirection
    404 if follow_relative_redirects:
--> 405     response = _request_wrapper(
    406         method=method,
    407         url=url,
    408         max_retries=max_retries,
    409         base_wait_time=base_wait_time,
    410         max_wait_time=max_wait_time,
    411         timeout=timeout,
    412         follow_relative_redirects=False,
    413         **params,
    414     )
    416     # If redirection, we redirect only relative paths.
    417     # This is useful in case of a renamed repository.
    418     if 300 <= response.status_code <= 399:

File ~/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py:440, in _request_wrapper(method, url, max_retries, base_wait_time, max_wait_time, timeout, follow_relative_redirects, **params)
    437     return response
    439 # 3. Exponential backoff
--> 440 return http_backoff(
    441     method=method,
    442     url=url,
    443     max_retries=max_retries,
    444     base_wait_time=base_wait_time,
    445     max_wait_time=max_wait_time,
    446     retry_on_exceptions=(ConnectTimeout, ProxyError),
    447     retry_on_status_codes=(),
    448     timeout=timeout,
    449     **params,
    450 )

File ~/miniconda3/lib/python3.10/site-packages/huggingface_hub/utils/_http.py:129, in http_backoff(method, url, max_retries, base_wait_time, max_wait_time, retry_on_exceptions, retry_on_status_codes, **kwargs)
    126     kwargs["data"].seek(io_obj_initial_pos)
    128 # Perform request and return if status_code is not in the retry list.
--> 129 response = requests.request(method=method, url=url, **kwargs)
    130 if response.status_code not in retry_on_status_codes:
    131     return response

File ~/miniconda3/lib/python3.10/site-packages/requests/api.py:59, in request(method, url, **kwargs)
     55 # By using the 'with' statement we are sure the session is closed, thus we
     56 # avoid leaving sockets open which can trigger a ResourceWarning in some
     57 # cases, and look like a memory leak in others.
     58 with sessions.Session() as session:
---> 59     return session.request(method=method, url=url, **kwargs)

File ~/miniconda3/lib/python3.10/site-packages/requests/sessions.py:587, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    582 send_kwargs = {
    583     "timeout": timeout,
    584     "allow_redirects": allow_redirects,
    585 }
    586 send_kwargs.update(settings)
--> 587 resp = self.send(prep, **send_kwargs)
    589 return resp

File ~/miniconda3/lib/python3.10/site-packages/requests/sessions.py:701, in Session.send(self, request, **kwargs)
    698 start = preferred_clock()
    700 # Send the request
--> 701 r = adapter.send(request, **kwargs)
    703 # Total elapsed time of the request (approximately)
    704 elapsed = preferred_clock() - start

File ~/miniconda3/lib/python3.10/site-packages/requests/adapters.py:489, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    487 try:
    488     if not chunked:
--> 489         resp = conn.urlopen(
    490             method=request.method,
    491             url=url,
    492             body=request.body,
    493             headers=request.headers,
    494             redirect=False,
    495             assert_same_host=False,
    496             preload_content=False,
    497             decode_content=False,
    498             retries=self.max_retries,
    499             timeout=timeout,
    500         )
    502     # Send the request.
    503     else:
    504         if hasattr(conn, "proxy_pool"):

File ~/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py:703, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    700     self._prepare_proxy(conn)
    702 # Make the request on the httplib connection object.
--> 703 httplib_response = self._make_request(
    704     conn,
    705     method,
    706     url,
    707     timeout=timeout_obj,
    708     body=body,
    709     headers=headers,
    710     chunked=chunked,
    711 )
    713 # If we're going to release the connection in ``finally:``, then
    714 # the response doesn't need to know about the connection. Otherwise
    715 # it will also try to release it and we'll have a double-release
    716 # mess.
    717 response_conn = conn if not release_conn else None

File ~/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py:398, in HTTPConnectionPool._make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    396         conn.request_chunked(method, url, **httplib_request_kw)
    397     else:
--> 398         conn.request(method, url, **httplib_request_kw)
    400 # We are swallowing BrokenPipeError (errno.EPIPE) since the server is
    401 # legitimately able to close the connection after sending a valid response.
    402 # With this behaviour, the received response is still readable.
    403 except BrokenPipeError:
    404     # Python 3

File ~/miniconda3/lib/python3.10/site-packages/urllib3/connection.py:239, in HTTPConnection.request(self, method, url, body, headers)
    237 if "user-agent" not in (six.ensure_str(k.lower()) for k in headers):
    238     headers["User-Agent"] = _get_default_user_agent()
--> 239 super(HTTPConnection, self).request(method, url, body=body, headers=headers)

File ~/miniconda3/lib/python3.10/http/client.py:1282, in HTTPConnection.request(self, method, url, body, headers, encode_chunked)
   1279 def request(self, method, url, body=None, headers={}, *,
   1280             encode_chunked=False):
   1281     """Send a complete request to the server."""
-> 1282     self._send_request(method, url, body, headers, encode_chunked)

File ~/miniconda3/lib/python3.10/http/client.py:1323, in HTTPConnection._send_request(self, method, url, body, headers, encode_chunked)
   1320     encode_chunked = False
   1322 for hdr, value in headers.items():
-> 1323     self.putheader(hdr, value)
   1324 if isinstance(body, str):
   1325     # RFC 2616 Section 3.7.1 says that text default has a
   1326     # default charset of iso-8859-1.
   1327     body = _encode(body, 'body')

File ~/miniconda3/lib/python3.10/site-packages/urllib3/connection.py:224, in HTTPConnection.putheader(self, header, *values)
    222 """ """
    223 if not any(isinstance(v, str) and v == SKIP_HEADER for v in values):
--> 224     _HTTPConnection.putheader(self, header, *values)
    225 elif six.ensure_str(header.lower()) not in SKIPPABLE_HEADERS:
    226     raise ValueError(
    227         "urllib3.util.SKIP_HEADER only supports '%s'"
    228         % ("', '".join(map(str.title, sorted(SKIPPABLE_HEADERS))),)
    229     )

File ~/miniconda3/lib/python3.10/http/client.py:1260, in HTTPConnection.putheader(self, header, *values)
   1257         values[i] = str(one_value).encode('ascii')
   1259     if _is_illegal_header_value(values[i]):
-> 1260         raise ValueError('Invalid header value %r' % (values[i],))
   1262 value = b'\r\n\t'.join(values)
   1263 header = header + b': ' + value

ValueError: Invalid header value b'Bearer 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\n'
```

### Expected behavior

Above scripts should load the tokenizer normally but now it raises `ValueError: Invalid header value b`

I am using Python from latest Miniconda and I only install `torch` `transformers`. Not sure what the cause of the issue.
Solved via deleting all cached files under ```~/.cache/huggingface```