encounter error ,OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory
The OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory
error I encountered is because the requires_safety_checker
parameter in model_index.json
is no longer functional in diffusers
version v0.34.0
. This parameter seems to have been removed.
To resolve this issue, pls do one of the following:
Add the
safety_checker=None
parameter when loading the pipeline.
For example:
pipeline = StableDiffusionPipeline.from_pretrained("hf-internal-testing/tiny-stable-diffusion-torch", safety_checker=None)
Remove the
safety_checker
configuration from yourmodel_index.json
file.
The safety_checker
component is used to check for and filter out images that may violate ethical and legal guidelines.