Skip to content

Commit 6f28328

Browse files
committed
Fix style
1 parent 13e44b0 commit 6f28328

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

optimum/commands/export/openvino.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
from typing import TYPE_CHECKING, Optional
2020

2121
from ...exporters import TasksManager
22-
from ..base import BaseOptimumCLICommand, CommandInfo
2322
from ...intel.utils.import_utils import DIFFUSERS_IMPORT_ERROR, is_diffusers_available
23+
from ..base import BaseOptimumCLICommand, CommandInfo
2424

2525

2626
logger = logging.getLogger(__name__)
@@ -212,7 +212,6 @@ def run(self):
212212
library_name = TasksManager.infer_library_from_model(self.args.model)
213213

214214
if library_name == "diffusers" and ov_config and ov_config.quantization_config.get("dataset"):
215-
216215
if not is_diffusers_available():
217216
raise ValueError(DIFFUSERS_IMPORT_ERROR.format("Export of diffusers models"))
218217

@@ -222,13 +221,11 @@ def run(self):
222221
class_name = diffusers_config.get("_class_name", None)
223222

224223
if class_name == "LatentConsistencyModelPipeline":
225-
226224
from optimum.intel import OVLatentConsistencyModelPipeline
227225

228226
model_cls = OVLatentConsistencyModelPipeline
229227

230228
elif class_name == "StableDiffusionXLPipeline":
231-
232229
from optimum.intel import OVStableDiffusionXLPipeline
233230

234231
model_cls = OVStableDiffusionXLPipeline
@@ -239,7 +236,9 @@ def run(self):
239236
else:
240237
raise NotImplementedError(f"Quantization in hybrid mode isn't supported for class {class_name}.")
241238

242-
model = model_cls.from_pretrained(self.args.model, export=True, quantization_config=ov_config.quantization_config)
239+
model = model_cls.from_pretrained(
240+
self.args.model, export=True, quantization_config=ov_config.quantization_config
241+
)
243242
model.save_pretrained(self.args.output)
244243

245244
else:

tests/openvino/test_exporters_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
from optimum.exporters.openvino.__main__ import main_export
2828
from optimum.intel import ( # noqa
29+
OVLatentConsistencyModelPipeline,
2930
OVModelForAudioClassification,
3031
OVModelForCausalLM,
3132
OVModelForFeatureExtraction,
@@ -37,7 +38,6 @@
3738
OVModelForTokenClassification,
3839
OVStableDiffusionPipeline,
3940
OVStableDiffusionXLPipeline,
40-
OVLatentConsistencyModelPipeline,
4141
)
4242
from optimum.intel.openvino.utils import _HEAD_TO_AUTOMODELS
4343
from optimum.intel.utils.import_utils import is_openvino_tokenizers_available

0 commit comments

Comments
 (0)