Skip to content

Commit b391e64

Browse files
committed
Set seq2seq ov_config in base model
1 parent 25da061 commit b391e64

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

optimum/intel/openvino/modeling_base_seq2seq.py

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ def __init__(
6767
self._device = device.upper()
6868
self.is_dynamic = dynamic_shapes
6969
self.ov_config = ov_config if ov_config is not None else {}
70+
71+
if self.ov_config.get("PERFORMANCE_HINT") is None:
72+
self.ov_config["PERFORMANCE_HINT"] = "LATENCY"
73+
7074
self.preprocessors = kwargs.get("preprocessors", [])
7175

7276
if self.is_dynamic:

optimum/intel/openvino/modeling_seq2seq.py

-4
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ def __init__(
253253
decoder: openvino.runtime.Model,
254254
decoder_with_past: openvino.runtime.Model = None,
255255
config: transformers.PretrainedConfig = None,
256-
ov_config: Optional[Dict[str, str]] = None,
257256
**kwargs,
258257
):
259258
super().__init__(
@@ -264,10 +263,7 @@ def __init__(
264263
enable_compilation = kwargs.get("compile", True)
265264
self.encoder = OVEncoder(self.encoder_model, parent_model=self)
266265
self.decoder = OVDecoder(self.decoder_model, parent_model=self)
267-
self.ov_config = ov_config if ov_config is not None else {}
268266

269-
if self.ov_config.get("PERFORMANCE_HINT") is None:
270-
self.ov_config["PERFORMANCE_HINT"] = "LATENCY"
271267
if self.use_cache:
272268
self.decoder_with_past = OVDecoder(self.decoder_with_past_model, parent_model=self)
273269
if enable_compilation:

0 commit comments

Comments
 (0)