open_llama tokenization modules import
Author: npapasarantopoulos
Pull request: no

### System Info

I stumbled upon this issue, which is not an issue with the OpenLLaMa implementation; I did not try to use OpenLLaMA. 
I am importing `transformers.pipeline` in a project including tests using [freezegun](https://github.com/spulec/freezegun) to freeze dates. It seems like freezegun recursively checks all imports of all imported modules, and I am getting the following error:

 `ModuleNotFoundError: No module named 'transformers.models.open_llama.tokenization_open_llama'`
and the same for `transformers.models.open_llama.tokenization_open_llama_fast`.

This is probably just an import error, since it seems that open_llama uses `LlamaTokenizer` and `LlamaTokenizerFast`; creating stubs for `transformers.models.open_llama.tokenization_open_llama` and `transformers.models.open_llama.tokenization_open_llama_fast` seems to solve the import issue and tests run just fine.

### Who can help?

@s-JoL 

### Information

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

### Tasks

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

### Reproduction

Minimal code to reproduce:

```
from freezegun import freeze_time

@freeze_time('2022-01-01 12:01:00')
def test_a():
    from transformers import pipeline
```

### Expected behavior

no import errors

Comments:
There is not a single line in the library trying that import, so it looks like an issue on `freezegun` more than on Transformers.

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.

Just hit this issue too with `freezegun`

<img width="1899" alt="image" src="https://github.com/huggingface/transformers/assets/4619775/a2149e8a-19ac-493f-8284-c26109621b88">


While this might be an issue with how freezegun loads dependencies, `freezegun` did not come up with those names: `transformers.models.open_llama.tokenization_open_llama`, `transformers.models.open_llama.tokenization_open_llama_fast`. They are referenced [here](https://github.com/huggingface/transformers/blob/2bd7a27a671fd1d98059124024f580f8f5c0f3b5/src/transformers/models/deprecated/open_llama/__init__.py#L35).

The temporary workaround I used is to create stubs for them using [surrogate](https://github.com/ikostia/surrogate) like this:
```
def pytest_sessionstart(session):
    @surrogate('transformers.models.open_llama.tokenization_open_llama')
    @surrogate('transformers.models.open_llama.tokenization_open_llama_fast')
    def freezegun_initial_import():
        pass
    freezegun_initial_import()
```

@npapasarantopoulos The link you show gives the name `tokenization_open_llama` defined in `transformers.models.deprecated.open_llama`, so it does seem like `freezegun` is making those names up.

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.

this still seems like a real issue and affects my codebase as well. not sure where/how this should be resolved. FWIW the linked [file](https://github.com/huggingface/transformers/blob/2bd7a27a671fd1d98059124024f580f8f5c0f3b5/src/transformers/models/deprecated/open_llama/__init__.py#L35) above looks pretty wack and requires careful inspection to see whether it is violating import machinery in a way that would cause errors elsewhere

I tried the workaround of https://github.com/huggingface/transformers/issues/24545#issuecomment-1663496369 but it did not fix things for me

in the root `conftest.py`
```
from surrogate import surrogate

def pytest_sessionstart(session):
    surrogate("transformers.models.deprecated.open_llama.tokenization_open_llama").prepare()
```


Another option is to use fixture but the fixture will be called for each worker while pytest_sessionstart is called only once. Pros of the fixture are that `__enter__` and `__exit__` will be called automatically which means base modules will be restored. Use
fixture in case you need base module restoration for some reason.

```
@pytest.fixture(scope="session", autouse=True)
def stub_freezegun_dynamic_imports():
    with surrogate("transformers.models.deprecated.open_llama.tokenization_open_llama"):
        yield
```

Thank you so much:
> ```
> @pytest.fixture(scope="session", autouse=True)
> def stub_freezegun_dynamic_imports():
>     with surrogate("transformers.models.deprecated.open_llama.tokenization_open_llama"):
>         yield
> ```

^^ Just saved my code base from a ton of ugly surrogates.

My final stub looks like in my root level `conftest.py`:
```
@fixture(scope="session", autouse=True)
def stub_freezegun_dynamic_imports():
    with surrogate("transformers.models.deprecated.open_llama.tokenization_open_llama"):
        with surrogate('transformers.models.deprecated.open_llama.tokenization_open_llama_fast'):
            with surrogate('transformers.models.open_llama.tokenization_open_llama'):
                with surrogate('transformers.models.open_llama.tokenization_open_llama_fast'):
                    yield
```
Which still of course beats doing this on every function I needed to do it for

Hey, if anyone else experiencing this issue while running unit test on your module you can also configure your freezegun to ignore some packages. 
[Documentation here](https://github.com/spulec/freezegun/blob/master/README.rst#ignore-packages)

In my use case 
`freezegun.config.configure(extend_ignore_list=["transformers"])`
fixed my tests