diff --git a/bentoml/_internal/frameworks/mlflow.py b/bentoml/_internal/frameworks/mlflow.py index 4b4768c15bb..bf88bfc1d04 100644 --- a/bentoml/_internal/frameworks/mlflow.py +++ b/bentoml/_internal/frameworks/mlflow.py @@ -4,6 +4,7 @@ import shutil import typing as t import logging +import tempfile from typing import TYPE_CHECKING import bentoml @@ -185,8 +186,6 @@ def import_model( metadata=metadata, context=context, ) as bento_model: - import tempfile - from mlflow.models import Model as MLflowModel from mlflow.pyfunc import FLAVOR_NAME as PYFUNC_FLAVOR_NAME from mlflow.models.model import MLMODEL_FILE_NAME