Skip to content

Commit

Permalink
add property for access to normalized config
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Jan 30, 2024
1 parent 30ab172 commit 35a376e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions optimum/intel/openvino/modeling_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
from transformers.file_utils import add_start_docstrings, add_start_docstrings_to_model_forward
from transformers.modeling_outputs import CausalLMOutputWithPast

from optimum.utils.normalized_config import NormalizedConfigManager

from ...exporters.openvino import ensure_stateful_is_available, main_export, patch_stateful
from ...exporters.openvino.stateful import model_has_state
from ..utils.import_utils import is_transformers_version
Expand Down Expand Up @@ -318,6 +320,13 @@ def reshape(self, batch_size: int, sequence_length: int):
logger.warning("Static shapes are not supported for causal language model.")
return self

@property
def normalized_config(self):
logger.warning(
"access to normalized_config attribute is deprecated and will be removed in future versions, please use config"
)
return NormalizedConfigManager.get_normalized_config_class(self.config.model_type)(self.config)

def compile(self):
if self.request is None:
super().compile()
Expand Down

0 comments on commit 35a376e

Please sign in to comment.