Exception: data did not match any variant of untagged enum PyPreTokenizerTypeWrapper at line 960 column 3

#36
by zhzhcookie - opened
This comment has been hidden

Loading pipeline components...: 33%|█████████████████████████████████████████████████ | 3/9 [00:00<00:01, 4.89it/s]
Traceback (most recent call last):
File "~/work/stable-diffusion-3-medium-diffusers/demo/test.py", line 4, in
pipe = StableDiffusion3Pipeline.from_pretrained("../stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16)
File "/root/.local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/root/.local/lib/python3.10/site-packages/diffusers/pipelines/pipeline_utils.py", line 881, in from_pretrained
loaded_sub_model = load_sub_model(
File "/root/.local/lib/python3.10/site-packages/diffusers/pipelines/pipeline_loading_utils.py", line 703, in load_sub_model
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 2028, in from_pretrained
return cls._from_pretrained(
File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 2260, in _from_pretrained
tokenizer = cls(*init_inputs, **init_kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/models/t5/tokenization_t5_fast.py", line 135, in init
super().init(
File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_fast.py", line 111, in init
fast_tokenizer = TokenizerFast.from_file(fast_tokenizer_file)
Exception: data did not match any variant of untagged enum PyPreTokenizerTypeWrapper at line 960 column 3

zhzhcookie changed discussion title from Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found to Exception: data did not match any variant of untagged enum PyPreTokenizerTypeWrapper at line 960 column 3

I need some help to run the demo.

I have downloaded stabilityai/stable-diffusion-3-medium-diffusers.

My command:

pip3 install -U diffusers --user
pip3 install torch
python3 test.py

My test.py is:

import torch
from diffusers import StableDiffusion3Pipeline

pipe = StableDiffusion3Pipeline.from_pretrained("../stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16)
#pipe = pipe.to("cuda")

image = pipe(
    "A cat holding a sign that says hello world",
    negative_prompt="",
    num_inference_steps=28,
    guidance_scale=7.0,
).images[0]
image

Finally, I solved all the problem and run the model successfully in 7 days. TT

Could u please share your solution? I just encounter this error.

solved by 'pip install transformers -U'

solved by 'pip install transformers -U'

thanks, it works.

Sign up or log in to comment