From d5ceb674582a1c2135e7cd5406cff2e4200febc6 Mon Sep 17 00:00:00 2001 From: eaidova Date: Wed, 4 Dec 2024 10:52:47 +0400 Subject: [PATCH] move decoder_merge import --- optimum/exporters/onnx/model_configs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optimum/exporters/onnx/model_configs.py b/optimum/exporters/onnx/model_configs.py index b39d19ec782..12cf9c6108b 100644 --- a/optimum/exporters/onnx/model_configs.py +++ b/optimum/exporters/onnx/model_configs.py @@ -21,7 +21,6 @@ from packaging import version from transformers.utils import is_tf_available -from ...onnx import merge_decoders from ...utils import ( DEFAULT_DUMMY_SHAPES, BloomDummyPastKeyValuesGenerator, @@ -1875,6 +1874,7 @@ def post_process_exported_models( decoder_with_past_path = Path(path, onnx_files_subpaths[3]) decoder_merged_path = Path(path, ONNX_DECODER_MERGED_NAME + ".onnx") try: + from ...onnx import merge_decoders # The decoder with past does not output the cross attention past key values as they are constant, # hence the need for strict=False merge_decoders(