diff --git a/optimum/executorchruntime/modeling_executorch.py b/optimum/executorchruntime/modeling_executorch.py index 39c75a03863..b93309f6a48 100644 --- a/optimum/executorchruntime/modeling_executorch.py +++ b/optimum/executorchruntime/modeling_executorch.py @@ -17,7 +17,7 @@ import warnings from pathlib import Path from tempfile import TemporaryDirectory -from typing import TYPE_CHECKING, List, Optional, Union +from typing import List, Optional, Union import torch from executorch.extension.pybindings.portable_lib import ( @@ -35,10 +35,6 @@ from ..modeling_base import OptimizedModel -if TYPE_CHECKING: - from transformers import PretrainedConfig - - logger = logging.getLogger(__name__) diff --git a/optimum/onnxruntime/runs/__init__.py b/optimum/onnxruntime/runs/__init__.py index d21db2a4aca..1d982949344 100644 --- a/optimum/onnxruntime/runs/__init__.py +++ b/optimum/onnxruntime/runs/__init__.py @@ -110,9 +110,9 @@ def __init__(self, run_config): model_class = FeaturesManager.get_model_class_for_feature(get_autoclass_name(self.task)) self.torch_model = model_class.from_pretrained(run_config["model_name_or_path"]) - self.return_body["model_type"] = ( - self.torch_model.config.model_type - ) # return_body is initialized in parent class + self.return_body[ + "model_type" + ] = self.torch_model.config.model_type # return_body is initialized in parent class def _launch_time(self, trial): batch_size = trial.suggest_categorical("batch_size", self.batch_sizes)