Skip to content

Commit 46e7781

Browse files
authored
fix getting default diffusion pipeline parameters from config (#983)
1 parent e5fb400 commit 46e7781

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

optimum/intel/openvino/modeling_diffusion.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ def _from_pretrained(
409409
"tokenizer_2": None,
410410
"tokenizer_3": None,
411411
"feature_extractor": None,
412+
"image_encoder": None,
413+
"safety_checker": None,
412414
}
413415
for name in submodels.keys():
414416
if kwargs.get(name) is not None:
@@ -434,6 +436,10 @@ def _from_pretrained(
434436
"text_encoder_3": model_save_path / DIFFUSION_MODEL_TEXT_ENCODER_3_SUBFOLDER / text_encoder_3_file_name,
435437
}
436438

439+
for config_key, value in config.items():
440+
if config_key not in models and config_key not in kwargs and config_key not in submodels:
441+
kwargs[config_key] = value
442+
437443
compile_only = kwargs.get("compile_only", False)
438444
quantization_config = cls._prepare_weight_quantization_config(quantization_config, load_in_8bit)
439445
if (quantization_config is None or quantization_config.dataset is None) and not compile_only:

0 commit comments

Comments
 (0)