due to registration ov diffusion pipeline components in pipeline config, their classes appears in model_index.json
after OVDiffusionPipeline.save_pretrained().
misalignment between optimum-cli result (cli tool preserves original model_index.json) and save_pretrained results
impossibility store original and ov pipeline in the same local directory or hub repository. if ov pipeline will be saved vi save_pretrained after original pipeline, you will not able to use original pipeline (model index json will contains wrong class names):
from diffusers import DiffusionPipeline
from optimum.intel.openvino import OVDiffusionPipeline
save_dir = "common_repo"
model_id = "hf-internal-testing/tiny-stable-diffusion-pipe-variants-right-format"
pipe = DiffusionPipeline.from_pretrained(model_id)
pipe.save_pretrained(save_dir)
ov_pipe = OVDiffusionPipeline.from_pretrained(model_id)
ov_pipe.save_pretrained(save_dir)
# try to load original pipeline again
pipe_from_local_dir = DiffusionPipeline.from_pretrained(save_dir)
raises error:
diffusers/utils/import_utils.py", line 846, in __getattr__
raise AttributeError(f"module {self.__name__} has no attribute {name}")
AttributeError: module diffusers has no attribute OVStableDiffusionPipeline
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
What does this PR do?
due to registration ov diffusion pipeline components in pipeline config, their classes appears in model_index.json after OVDiffusionPipeline.save_pretrained().
That may bring some inconvinience:
raises error: