From 860bdf84b118e0a38ee8279747a9470e2a656965 Mon Sep 17 00:00:00 2001 From: Ekaterina Aidova Date: Wed, 27 Nov 2024 12:04:15 +0400 Subject: [PATCH] fix updated broken checking nondefault parameters (#1038) --- optimum/exporters/openvino/convert.py | 2 +- optimum/intel/openvino/modeling_base.py | 2 +- optimum/intel/openvino/modeling_base_seq2seq.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/optimum/exporters/openvino/convert.py b/optimum/exporters/openvino/convert.py index 18f2efa7a..5b9aea10e 100644 --- a/optimum/exporters/openvino/convert.py +++ b/optimum/exporters/openvino/convert.py @@ -692,7 +692,7 @@ def export_from_model( # some model configs may have issues with loading without parameters initialization try: misplaced_generation_parameters = model.config._get_non_default_generation_parameters() - except KeyError: + except (KeyError, TypeError): misplaced_generation_parameters = {} if isinstance(model, GenerationMixin) and len(misplaced_generation_parameters) > 0: logger.warning( diff --git a/optimum/intel/openvino/modeling_base.py b/optimum/intel/openvino/modeling_base.py index 4c91169bb..d5d566689 100644 --- a/optimum/intel/openvino/modeling_base.py +++ b/optimum/intel/openvino/modeling_base.py @@ -139,7 +139,7 @@ def __init__( # some model configs may have issues with loading without parameters initialization try: misplaced_generation_parameters = self.config._get_non_default_generation_parameters() - except KeyError: + except (KeyError, TypeError): misplaced_generation_parameters = {} if len(misplaced_generation_parameters) > 0: logger.warning( diff --git a/optimum/intel/openvino/modeling_base_seq2seq.py b/optimum/intel/openvino/modeling_base_seq2seq.py index 0ce15641f..d01c396a4 100644 --- a/optimum/intel/openvino/modeling_base_seq2seq.py +++ b/optimum/intel/openvino/modeling_base_seq2seq.py @@ -87,7 +87,7 @@ def __init__( # some model configs may have issues with loading without parameters initialization try: misplaced_generation_parameters = self.config._get_non_default_generation_parameters() - except KeyError: + except (KeyError, TypeError): misplaced_generation_parameters = {} if len(misplaced_generation_parameters) > 0: logger.warning(