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

Enable OpenVINO export of loaded model #557

Merged
merged 27 commits into from
Feb 15, 2024
Merged

Enable OpenVINO export of loaded model #557

merged 27 commits into from
Feb 15, 2024

Conversation

echarlaix
Copy link
Collaborator

@echarlaix echarlaix commented Feb 9, 2024

from diffusers import StableDiffusionPipeline
from optimum.intel import OVStableDiffusionPipeline
from optimum.exporters.openvino import export_from_model

model_id = "runwayml/stable-diffusion-v1-5"
model = StableDiffusionPipeline.from_pretrained(model_id)

save_dir = "ov_model"
export_from_model(model, output=save_dir, task="stable-diffusion")
pipeline = OVStableDiffusionPipeline.from_pretrained(save_dir)
images = pipeline("sailing ship in storm by Rembrandt").images

@echarlaix echarlaix marked this pull request as draft February 9, 2024 14:03
@HuggingFaceDocBuilderDev

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.

@echarlaix echarlaix marked this pull request as ready for review February 12, 2024 14:10
@@ -700,7 +650,7 @@ def get_nncf_config(pipeline, dataloader, args):
"ignored_scopes": [
"{re}.*__add___[0-2]",
"{re}.*layer_norm_0",
"{re}.*Attention.*/bmm_0",
# "{re}.*Attention.*/bmm_0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get the following error from nncf when left uncommented :
No match has been found among the model operations for the following ignored/target scope definitions

@echarlaix echarlaix merged commit 7e1a21e into main Feb 15, 2024
12 checks passed
@echarlaix echarlaix deleted the export-refactor branch February 15, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants