From 055297edb53c3b81b7d476d4b83f2e01f9691edc Mon Sep 17 00:00:00 2001 From: Ella Charlaix Date: Thu, 19 Dec 2024 11:13:15 +0100 Subject: [PATCH] add comment --- optimum/exporters/onnx/base.py | 2 ++ optimum/exporters/onnx/config.py | 3 +++ optimum/exporters/onnx/convert.py | 2 ++ optimum/exporters/onnx/model_configs.py | 3 +++ 4 files changed, 10 insertions(+) diff --git a/optimum/exporters/onnx/base.py b/optimum/exporters/onnx/base.py index 137e024ce77..b5adb4522a2 100644 --- a/optimum/exporters/onnx/base.py +++ b/optimum/exporters/onnx/base.py @@ -50,6 +50,8 @@ from .model_patcher import ModelPatcher, Seq2SeqModelPatcher +# TODO : moved back onnx imports applied in https://github.com/huggingface/optimum/pull/2114/files after refactorization + if is_accelerate_available(): from accelerate.utils import find_tied_parameters diff --git a/optimum/exporters/onnx/config.py b/optimum/exporters/onnx/config.py index d4e0630171b..69366d6be13 100644 --- a/optimum/exporters/onnx/config.py +++ b/optimum/exporters/onnx/config.py @@ -37,6 +37,9 @@ from .model_patcher import DecoderModelPatcher +# TODO : moved back onnx imports applied in https://github.com/huggingface/optimum/pull/2114/files after refactorization + + if TYPE_CHECKING: from transformers import PretrainedConfig, PreTrainedModel diff --git a/optimum/exporters/onnx/convert.py b/optimum/exporters/onnx/convert.py index 0d4c544cd3a..80d945580c7 100644 --- a/optimum/exporters/onnx/convert.py +++ b/optimum/exporters/onnx/convert.py @@ -57,6 +57,8 @@ ) +# TODO : moved back onnx imports applied in https://github.com/huggingface/optimum/pull/2114/files after refactorization + if is_torch_available(): import torch import torch.nn as nn diff --git a/optimum/exporters/onnx/model_configs.py b/optimum/exporters/onnx/model_configs.py index fdb69317277..315fced395a 100644 --- a/optimum/exporters/onnx/model_configs.py +++ b/optimum/exporters/onnx/model_configs.py @@ -92,6 +92,9 @@ ) +# TODO : moved back onnx imports applied in https://github.com/huggingface/optimum/pull/2114/files after refactorization + + if TYPE_CHECKING: from transformers import PretrainedConfig from transformers.modeling_utils import PreTrainedModel