Skip to content

Commit

Permalink
Fix for bloom family
Browse files Browse the repository at this point in the history
  • Loading branch information
slyalin authored and eaidova committed Jan 8, 2024
1 parent 49a7f8f commit 3bf4272
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions optimum/exporters/openvino/stateful.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3bf4272

Please sign in to comment.