Skip to content

Commit

Permalink
fix loading safety checker in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Nov 4, 2024
1 parent 74d2161 commit 591dbfa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions optimum/intel/openvino/modeling_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ def _from_pretrained(
"tokenizer_2": None,
"tokenizer_3": None,
"feature_extractor": None,
"image_encoder": None,
"safety_checker": None,
}

additional_submodels = ["image_encoder", "safety_checker"]
for name in submodels.keys():
if kwargs.get(name) is not None:
submodels[name] = kwargs.pop(name)
Expand All @@ -437,7 +437,12 @@ def _from_pretrained(
}

for config_key, value in config.items():
if config_key not in models and config_key not in kwargs and config_key not in submodels:
if (
config_key not in models
and config_key not in kwargs
and config_key not in submodels
and config_key not in additional_submodels
):
kwargs[config_key] = value

compile_only = kwargs.get("compile_only", False)
Expand Down

0 comments on commit 591dbfa

Please sign in to comment.