Incompatible with Transformers v4.45.1

#114
by AbheekG - opened

Thank you for this excellent, amazing model!

New useful models such as Llama3.2-Vision require Transformers v4.45.1, but FLUX refuses to work on it, throwing out the error attached at the end of this post.

Here's the strange part: this error does NOT appear and FLUX loads just fine on PIP transformers v4.44.0, but on v4.45.1, we get the error below. What's so weird about this is the fact that the mentioned package, protobuf, is not related to Transformers, in the sense that it's version stays the same.

That is, when I downgrade to Transformers v4.44.0, the version of protobuf stays the same but FLUX works! I have reproduced and confirmed that downgrading Transformers allows FLUX to work, and upgrading allows Llama3.2-Vision to work!

Hoping for some guidance/resolution. Thanks a ton again!

<|error|>
Loading checkpoint shards: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2/2 [00:00<00:00, 2.27it/s]
Loading pipeline components...: 71%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 5/7 [00:01<00:00, 3.32it/s]You set add_prefix_space. The tokenizer needs to be converted from the slow tokenizers
Loading pipeline components...: 71%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 5/7 [00:01<00:00, 2.53it/s]

Could not load Flux Pipeline, encountered error: 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

Could not load Flux Pipeline, encountered error: 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

Traceback (most recent call last):
File "C:\Users\abhee\OneDrive\Documents\Work_Stuff\LLMs\LARS-Enterprise\web_app\hf_waitress.py", line 885, in load_flux_pipeline
pipeline = FluxPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 876, in from_pretrained
loaded_sub_model = load_sub_model(
^^^^^^^^^^^^^^^
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\diffusers\pipelines\pipeline_loading_utils.py", line 700, in load_sub_model
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_base.py", line 2216, in from_pretrained
return cls._from_pretrained(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_base.py", line 2450, in _from_pretrained
tokenizer = cls(*init_inputs, **init_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\models\t5\tokenization_t5_fast.py", line 119, in init
super().init(
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_fast.py", line 133, in init
fast_tokenizer = convert_slow_tokenizer(slow_tokenizer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\convert_slow_tokenizer.py", line 1584, in convert_slow_tokenizer
return converter_class(transformer_tokenizer).converted()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\convert_slow_tokenizer.py", line 550, in init
model_pb2 = import_protobuf()
^^^^^^^^^^^^^^^^^
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\convert_slow_tokenizer.py", line 38, in import_protobuf
from sentencepiece import sentencepiece_model_pb2
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\site-packages\sentencepiece\sentencepiece_model_pb2.py", line 34, in
_descriptor.EnumValueDescriptor(
File "C:\Users\abhee\AppData\Local\Programs\Python\Python311\Lib\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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\abhee\OneDrive\Documents\Work_Stuff\LLMs\LARS-Enterprise\web_app\hf_waitress.py", line 1072, in initialize_model
PIPE = load_flux_pipeline(PIPE)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\abhee\OneDrive\Documents\Work_Stuff\LLMs\LARS-Enterprise\web_app\hf_waitress.py", line 892, in load_flux_pipeline
handle_local_error("Could not load Flux Pipeline, encountered error: ", e)
File "C:\Users\abhee\OneDrive\Documents\Work_Stuff\LLMs\LARS-Enterprise\web_app\hf_waitress.py", line 96, in handle_local_error
raise Exception(exception)
Exception: 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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\abhee\OneDrive\Documents\Work_Stuff\LLMs\LARS-Enterprise\web_app\hf_waitress.py", line 1768, in
initialize_model()
File "C:\Users\abhee\OneDrive\Documents\Work_Stuff\LLMs\LARS-Enterprise\web_app\hf_waitress.py", line 1075, in initialize_model
handle_local_error("Could not load Flux Pipeline, encountered error: ", e)
File "C:\Users\abhee\OneDrive\Documents\Work_Stuff\LLMs\LARS-Enterprise\web_app\hf_waitress.py", line 96, in handle_local_error
raise Exception(exception)
Exception: 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

<|/error|>

Sign up or log in to comment