Failed to import due to invalid escape sequence '\d' (modeling_utils.py, line 1825)
Author: helpmefindaname
Pull request: no

### System Info

- `transformers` version: 4.28.1
- Platform: Windows-10-10.0.22621-SP0
- Python version: 3.10.10
- Huggingface_hub version: 0.13.4
- Safetensors version: not installed
- PyTorch version (GPU?): 2.0.0+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?: False
- Using distributed or parallel set-up in script?: False

### 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

I did not manage to recreate the bug consistently, however I had it appear on both windows and linux and on python3.8 and python3.10. 

I lack understanding, why it sometimes works and sometimes throws a syntax error. From my python-understanding, this should fail on all python environments with all transformers versions above `4.27.0`.

in python environment, run
`from transformers import AlbertModel` # or any other model
will **sometimes** lead to an error:
```
module = <module 'transformers' from '.../.venv/lib/python3.10/site-packages/transformers/__init__.py'>
fromlist = ('AlbertModel', 'AlbertTokenizer', 'BertModel', 'BertTokenizer', 'CamembertModel', 'CamembertTokenizer', ...)
import_ = <built-in function __import__>
>   ???
<frozen importlib._bootstrap>:1075: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <module 'transformers' from '.../.venv/lib/python3.10/site-packages/transformers/__init__.py'>
name = 'AlbertModel'
    def __getattr__(self, name: str) -> Any:
        if name in self._objects:
            return self._objects[name]
        if name in self._modules:
            value = self._get_module(name)
        elif name in self._class_to_module.keys():
            module = self._get_module(self._class_to_module[name])
>           value = getattr(module, name)
.venv/lib/python3.10/site-packages/transformers/utils/import_utils.py:1137: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <module 'transformers.models.albert' from '.../.venv/lib/python3.10/site-packages/transformers/models/albert/__init__.py'>
name = 'AlbertModel'
    def __getattr__(self, name: str) -> Any:
        if name in self._objects:
            return self._objects[name]
        if name in self._modules:
            value = self._get_module(name)
        elif name in self._class_to_module.keys():
>           module = self._get_module(self._class_to_module[name])
.venv/lib/python3.10/site-packages/transformers/utils/import_utils.py:1136: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <module 'transformers.models.albert' from '.../.venv/lib/python3.10/site-packages/transformers/models/albert/__init__.py'>
module_name = 'modeling_albert'
    def _get_module(self, module_name: str):
        try:
            return importlib.import_module("." + module_name, self.__name__)
        except Exception as e:
>           raise RuntimeError(
                f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its"
                f" traceback):\n{e}"
            ) from e
E           RuntimeError: Failed to import transformers.models.albert.modeling_albert because of the following error (look up to see its traceback):
E           invalid escape sequence '\d' (modeling_utils.py, line 1825)
.venv/lib/python3.10/site-packages/transformers/utils/import_utils.py:1148: RuntimeError
```

The error ocours due to https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1832 using an invalid escape sequence and therefore not being right python syntax. 
The fix would be to use `reg = re.compile(r"(.*?)-\d{5}-of-\d{5}")` instead to disable escape sequences and write a plain regex instead.


### Expected behavior

I would expect to be able to import transformer models without it sometimes trowing a RuntimeError.

Comments:
Solved in https://github.com/huggingface/transformers/pull/22936