Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
wgzintel committed Dec 13, 2023
1 parent 2560094 commit ef7f467
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions optimum/intel/openvino/modeling_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,10 @@ def compile(self):
logger.info(f"Setting OpenVINO CACHE_DIR to {str(cache_dir)}")
self.request = core.compile_model(self.model, self._device, ov_config)
# OPENVINO_LOG_LEVEL can be found in https://docs.openvino.ai/2023.2/openvino_docs_OV_UG_supported_plugins_AUTO_debugging.html
if 'OPENVINO_LOG_LEVEL' in os.environ and int(os.environ['OPENVINO_LOG_LEVEL']) > 2:
logger.info(f'{self._device} SUPPORTED_PROPERTIES:')
if "OPENVINO_LOG_LEVEL" in os.environ and int(os.environ["OPENVINO_LOG_LEVEL"]) > 2:
logger.info(f"{self._device} SUPPORTED_PROPERTIES:")
print_compiled_model_properties(self.request)


def _reshape(
self,
model: openvino.runtime.Model,
Expand Down
10 changes: 5 additions & 5 deletions optimum/intel/openvino/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import numpy as np
from huggingface_hub import model_info
from openvino.runtime import Type,properties
from openvino.runtime import Type, properties
from transformers.onnx.utils import ParameterFormat, compute_serialized_parameters_size


Expand Down Expand Up @@ -131,14 +131,14 @@ def _is_timm_ov_dir(model_dir):
def print_compiled_model_properties(compiled_model):
keys = compiled_model.get_property(properties.supported_properties())
for k in keys:
skip_keys = ('SUPPORTED_METRICS', 'SUPPORTED_CONFIG_KEYS', properties.supported_properties())
skip_keys = ("SUPPORTED_METRICS", "SUPPORTED_CONFIG_KEYS", properties.supported_properties())
if k not in skip_keys:
value = compiled_model.get_property(k)
if k == properties.device.properties():
for device_key in value.keys():
logger.info(f' {device_key}:')
logger.info(f" {device_key}:")
for k2, value2 in value.get(device_key).items():
if k2 not in skip_keys:
logger.info(f' {k2}: {value2}')
logger.info(f" {k2}: {value2}")
else:
logger.info(f' {k}: {value}')
logger.info(f" {k}: {value}")

0 comments on commit ef7f467

Please sign in to comment.