From f3962cad1b0ab1d6286b1b57fd7ee858eca7bc5d Mon Sep 17 00:00:00 2001 From: eaidova Date: Thu, 19 Dec 2024 08:47:00 +0400 Subject: [PATCH] fix style --- optimum/exporters/onnx/base.py | 2 -- optimum/exporters/onnx/config.py | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/optimum/exporters/onnx/base.py b/optimum/exporters/onnx/base.py index f1b6ad1f37..137e024ce7 100644 --- a/optimum/exporters/onnx/base.py +++ b/optimum/exporters/onnx/base.py @@ -311,8 +311,6 @@ def fix_dynamic_axes( # We branch here to avoid doing an unnecessary forward pass. if to_fix: - import onnx - if input_shapes is None: input_shapes = {} dummy_inputs = self.generate_dummy_inputs(framework="np", **input_shapes) diff --git a/optimum/exporters/onnx/config.py b/optimum/exporters/onnx/config.py index 43709ed32f..d4e0630171 100644 --- a/optimum/exporters/onnx/config.py +++ b/optimum/exporters/onnx/config.py @@ -19,6 +19,7 @@ from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Union from transformers.utils import is_tf_available + from ...utils import ( DummyAudioInputGenerator, DummyBboxInputGenerator, @@ -128,6 +129,7 @@ def post_process_exported_models( # Attempt to merge only if the decoder-only was exported separately without/with past if self.use_past is True and len(models_and_onnx_configs) == 2: from ...onnx import merge_decoders + decoder_path = Path(path, onnx_files_subpaths[0]) decoder_with_past_path = Path(path, onnx_files_subpaths[1]) decoder_merged_path = Path(path, ONNX_DECODER_MERGED_NAME + ".onnx")