From 26f2ce1e703f9d7151e5f87b262cc75cef75bb13 Mon Sep 17 00:00:00 2001 From: Helena Date: Wed, 25 Oct 2023 19:35:45 +0200 Subject: [PATCH] Copy ov_config for seq2seq models --- optimum/intel/openvino/modeling_seq2seq.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/optimum/intel/openvino/modeling_seq2seq.py b/optimum/intel/openvino/modeling_seq2seq.py index c800312e82..6b759054d0 100644 --- a/optimum/intel/openvino/modeling_seq2seq.py +++ b/optimum/intel/openvino/modeling_seq2seq.py @@ -203,7 +203,7 @@ def __init__( self.decoder_with_past = None enable_compilation = kwargs.get("compile", True) encoder_cache_dir = Path(self.model_save_dir).joinpath("encoder_cache") - ov_encoder_config = self.ov_config + ov_encoder_config = {**self.ov_config} if "CACHE_DIR" not in ov_encoder_config.keys() and not str(self.model_save_dir).startswith(gettempdir()): ov_encoder_config["CACHE_DIR"] = str(encoder_cache_dir) @@ -213,7 +213,7 @@ def __init__( ) decoder_cache_dir = Path(self.model_save_dir).joinpath("decoder_cache") - ov_decoder_config = self.ov_config + ov_decoder_config = {**self.ov_config} if "CACHE_DIR" not in ov_decoder_config.keys() and not str(self.model_save_dir).startswith(gettempdir()): ov_decoder_config["CACHE_DIR"] = str(decoder_cache_dir) @@ -222,7 +222,7 @@ def __init__( if self.use_cache: decoder_past_cache_dir = Path(self.model_save_dir).joinpath("decoder_past_cache") - ov_decoder_past_config = self.ov_config + ov_decoder_past_config = {**self.ov_config} if "CACHE_DIR" not in ov_decoder_past_config.keys() and not str(self.model_save_dir).startswith( gettempdir()