error with protoBug in v4.27.3
Author: quertenmont
Pull request: no

Hello,

I'be just updated my stack to python 3.11.2 and everything works fine except,
my tensorflow transformer models :-)

I'm using tensorflow-cpu implementation and here is the error I am facing when loading my model.

Any idea of what could be wrong ?

```
  File "/usr/local/lib/python3.11/site-packages/transformers/pipelines/__init__.py", line 873, in pipeline
    tokenizer = AutoTokenizer.from_pretrained(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/models/auto/tokenization_auto.py", line 697, in from_pretrained
    return tokenizer_class_fast.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/tokenization_utils_base.py", line 1804, in from_pretrained
    return cls._from_pretrained(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/tokenization_utils_base.py", line 1958, in _from_pretrained
    tokenizer = cls(*init_inputs, **init_kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/models/camembert/tokenization_camembert_fast.py", line 128, in __init__
    super().__init__(
  File "/usr/local/lib/python3.11/site-packages/transformers/tokenization_utils_fast.py", line 114, in __init__
    fast_tokenizer = convert_slow_tokenizer(slow_tokenizer)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/convert_slow_tokenizer.py", line 1199, in convert_slow_tokenizer
    return converter_class(transformer_tokenizer).converted()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/convert_slow_tokenizer.py", line 438, in __init__
    from .utils import sentencepiece_model_pb2 as model_pb2
  File "/usr/local/lib/python3.11/site-packages/transformers/utils/sentencepiece_model_pb2.py", line 91, in <module>
    _descriptor.EnumValueDescriptor(
  File "/usr/local/lib/python3.11/site-packages/google/protobuf/descriptor.py", line 796, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
```

If it can help,
the code that trigger the issue is this one:
```
                SENTIMENT_FR = pipeline(
                    task="text-classification",  # type: ignore
                    model="cmarkea/distilcamembert-base-sentiment",  # type: ignore
                    tokenizer="cmarkea/distilcamembert-base-sentiment",  # type: ignore
                )
```


Comments:
cc @Narsil and @ArthurZucker 

@quertenmont

Could you share your environment by running `transformers-cli env`?

While @Narsil and @ArthurZucker find the time to check, for a quick fix, probably downgrade `tensorflow` and `protobuf` version. 

@sgugger Didn't we upgrade the protobuf generated file in the end ?

Also this happens to be a Camembert, which is BPE + spm (so subject to the bug we fixed in the merge ordering).

@quertenmont this used to be extremely slow no ? (This code converts from slow to fast on the fly, and for this particular tokenizer brand, it should be excruciantingly slow, since `tokenizers` has to recreate information by doing an O(n²) search over the tokens.)

No the protobuf generated file has not been touched at all @Narsil (and we will probably need to have two versions of it to support several versions of protobuf).

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.

Created this: https://github.com/huggingface/transformers/pull/23013

I'll try to run slow tests of tokenization on some machine in addition to the standard tests there


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.