From 3bf42728d35c57f25b7a68230a3303c02e4a532e Mon Sep 17 00:00:00 2001 From: Sergey Lyalin Date: Tue, 19 Dec 2023 10:56:48 +0000 Subject: [PATCH] Fix for bloom family --- optimum/exporters/openvino/stateful.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/optimum/exporters/openvino/stateful.py b/optimum/exporters/openvino/stateful.py index 990729bbc1..800ac9cb97 100644 --- a/optimum/exporters/openvino/stateful.py +++ b/optimum/exporters/openvino/stateful.py @@ -22,7 +22,11 @@ from packaging import version import openvino as ov from openvino.runtime import opset13 +<<<<<<< HEAD from optimum.intel.utils.import_utils import _openvino_version, is_openvino_version +======= +from optimum.intel.utils.import_utils import is_openvino_version +>>>>>>> Fix for bloom family from optimum.utils.normalized_config import NormalizedConfigManager @@ -224,8 +228,13 @@ def patch_stateful(config: PretrainedConfig, ov_model: ov.Model): fuse_cache_reorder(ov_model, not_kv_inputs, key_value_input_names, batch_dim) +<<<<<<< HEAD normalized_config = NormalizedConfigManager.get_normalized_config_class(config.model_type)(config) num_attention_heads = normalized_config.num_attention_heads if config.model_type == "bloom" else 1 +======= + normalized_config = NormalizedConfigManager.get_normalized_config_class(model.config.model_type)(model.config) + num_attention_heads = normalized_config.num_attention_heads if model.config.model_type == 'bloom' else 1 +>>>>>>> Fix for bloom family make_stateful( ov_model, not_kv_inputs, key_value_input_names, key_value_output_names, batch_dim, num_attention_heads, None