Error using with Python: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory Counterfeit-V2.5\text_encoder.

#21
by debxylen - opened

Getting this error:

The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling transformers.utils.move_cache().

0it [00:00, ?it/s]
0it [00:00, ?it/s]
Traceback (most recent call last):
File "C:\Users\admin\Desktop\Counterfeit-V2.5\main.py", line 3, in
pipeline = DiffusionPipeline.from_pretrained("Counterfeit-V2.5")
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\pipeline_utils.py", line 709, in from_pretrained
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\modeling_utils.py", line 3206, in from_pretrained
raise EnvironmentError(
OSError: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory Counterfeit-V2.5\text_encoder.

CODE:
from diffusers import DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained("Counterfeit-V2.5")
pipe.to("cuda")

saveall = False
prompt = input("Prompt: ")

if saveall==False:
image = pipe(prompt).images[0]
image.save("%s.png"%prompt)
else:
image = pipe(prompt).images
ii=1
for i in image:
image.save("%s%d.png"%(prompt,ii))
ii+=1

Sign up or log in to comment