the newest version of protobuf dont support the cmd of "google.protobuf.__version__" as in /transformers/convert_slow_tokenizer.py", line 36
Author: Jeryi-Sun
Pull request: no

### System Info

Traceback (most recent call last):
  File "/home/zhongxiang_sun/code/CHLLM/LLaMA-Efficient-Tuning-main/src/train_bash.py", line 14, in <module>
    main()
  File "/home/zhongxiang_sun/code/CHLLM/LLaMA-Efficient-Tuning-main/src/train_bash.py", line 5, in main
    run_exp()
  File "/home/zhongxiang_sun/code/CHLLM/LLaMA-Efficient-Tuning-main/src/llmtuner/tuner/tune.py", line 26, in run_exp
    run_sft(model_args, data_args, training_args, finetuning_args, generating_args, callbacks)
  File "/home/zhongxiang_sun/code/CHLLM/LLaMA-Efficient-Tuning-main/src/llmtuner/tuner/sft/workflow.py", line 28, in run_sft
    model, tokenizer = load_model_and_tokenizer(model_args, finetuning_args, training_args.do_train, stage="sft")
  File "/home/zhongxiang_sun/code/CHLLM/LLaMA-Efficient-Tuning-main/src/llmtuner/tuner/core/loader.py", line 71, in load_model_and_tokenizer
    tokenizer = AutoTokenizer.from_pretrained(
  File "/home/zhongxiang_sun/anaconda3/envs/eLLM/lib/python3.9/site-packages/transformers/models/auto/tokenization_auto.py", line 727, in from_pretrained
    return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
  File "/home/zhongxiang_sun/anaconda3/envs/eLLM/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 1854, in from_pretrained
    return cls._from_pretrained(
  File "/home/zhongxiang_sun/anaconda3/envs/eLLM/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 1886, in _from_pretrained
    slow_tokenizer = (cls.slow_tokenizer_class)._from_pretrained(
  File "/home/zhongxiang_sun/anaconda3/envs/eLLM/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 2017, in _from_pretrained
    tokenizer = cls(*init_inputs, **init_kwargs)
  File "/home/zhongxiang_sun/anaconda3/envs/eLLM/lib/python3.9/site-packages/transformers/models/llama/tokenization_llama.py", line 156, in __init__
    self.sp_model = self.get_spm_processor()
  File "/home/zhongxiang_sun/anaconda3/envs/eLLM/lib/python3.9/site-packages/transformers/models/llama/tokenization_llama.py", line 164, in get_spm_processor
    model_pb2 = import_protobuf()
  File "/home/zhongxiang_sun/anaconda3/envs/eLLM/lib/python3.9/site-packages/transformers/convert_slow_tokenizer.py", line 36, in import_protobuf
    if version.parse(google.protobuf.__version__) < version.parse("4.0.0"):
AttributeError: module 'google.protobuf' has no attribute '__version__'

### Who can help?

Jeryi

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

run "google.protobuf.__version__"

### Expected behavior

the newest version of protobuf dont support the cmd of "google.protobuf.__version__" as in /transformers/convert_slow_tokenizer.py", line 36

Comments:
Indeed, the check doesn't seem to work with recent protobuf versions cc @ArthurZucker @Rocketknight1 

Taking this one!

Hi @Jeryi-Sun I can't reproduce this with the latest version of `protobuf` on `pip`. This code works fine for me:

```python
>>> from google import protobuf
>>> protobuf.__version__
'4.24.3'
```

The actual code in the library is:
```python
version.parse(google.protobuf.__version__) < version.parse("4.0.0")
```

Is it possible that some code was incorrectly copied? If the code was copied into markdown, then `__version__` would become __version__ in bold (this is what happened in your bug report above). If this formatted code was copied back into Python, then the code would search for `google.protobuf.version` instead of the correct `google.protobuf.__version__`, which might cause the error?

I am sorry to bother you; maybe this error has been fixed or is my computer's problem.  Today I try again and it works too.

No problem - I'm just happy the problem was resolved!