Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix misplaced configs saving #1159

Merged
merged 2 commits into from
Feb 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
correct place for diffusers config search
eaidova committed Feb 12, 2025
commit 95e3c82bed578759f620175bb9aa50602345c23b
4 changes: 2 additions & 2 deletions optimum/intel/openvino/modeling_diffusion.py
Original file line number Diff line number Diff line change
@@ -294,8 +294,8 @@ def _save_pretrained(self, save_directory: Union[str, Path]):
dst_path = save_path / OV_XML_FILE_NAME
dst_path.parent.mkdir(parents=True, exist_ok=True)
openvino.save_model(model.model, dst_path, compress_to_fp16=False)
model_dir = model.config.get("_name_or_path", None) or model.model_save_dir
config_path = Path(model_dir) / CONFIG_NAME
model_dir = self.config.get("_name_or_path", None) or model.model_save_dir
config_path = Path(model_dir) / save_path.name / CONFIG_NAME
if config_path.is_file():
config_save_path = save_path / CONFIG_NAME
shutil.copyfile(config_path, config_save_path)