From 70cf213723832408ff02e9382a2ff6cd242d908c Mon Sep 17 00:00:00 2001 From: bojiang Date: Mon, 26 Jun 2023 16:20:10 +0800 Subject: [PATCH] fix(scheduling): expose Strategy class --- src/bentoml/__init__.py | 105 ++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/src/bentoml/__init__.py b/src/bentoml/__init__.py index f625ba67fff..1b8a8bbd77f 100644 --- a/src/bentoml/__init__.py +++ b/src/bentoml/__init__.py @@ -17,71 +17,69 @@ from typing import TYPE_CHECKING -from ._internal.configuration import load_config -from ._internal.configuration import save_config from ._internal.configuration import BENTOML_VERSION as __version__ -from ._internal.configuration import set_serialization_strategy +from ._internal.configuration import ( + load_config, + save_config, + set_serialization_strategy, +) # Inject dependencies and configurations load_config() -# Bento management APIs -from .bentos import get -from .bentos import list # pylint: disable=W0622 -from .bentos import pull -from .bentos import push -from .bentos import serve -from .bentos import delete -from .bentos import export_bento -from .bentos import import_bento - -# server API -from .server import GrpcServer -from .server import HTTPServer - -# BentoML built-in types -from ._internal.tag import Tag from ._internal.bento import Bento -from ._internal.models import Model -from ._internal.runner import Runner -from ._internal.runner import Runnable +from ._internal.cloud import YataiClient from ._internal.context import ServiceContext as Context -from ._internal.service import Service +from ._internal.models import Model from ._internal.monitoring import monitor -from ._internal.utils.http import Cookie -from ._internal.cloud import YataiClient +from ._internal.runner import Runnable, Runner +from ._internal.runner.strategy import Strategy +from ._internal.service import Service from ._internal.service.loader import load +# BentoML built-in types +from ._internal.tag import Tag +from ._internal.utils.http import Cookie + +# Bento management APIs +from .bentos import list # pylint: disable=W0622 +from .bentos import delete, export_bento, get, import_bento, pull, push, serve + +# server API +from .server import GrpcServer, HTTPServer + # Framework specific modules, model management and IO APIs are lazily loaded upon import. if TYPE_CHECKING: - from . import h2o - from . import ray - from . import flax - from . import onnx - from . import gluon - from . import keras - from . import spacy - from . import fastai - from . import mlflow - from . import paddle - from . import triton - from . import easyocr - from . import pycaret - from . import pytorch - from . import sklearn - from . import xgboost - from . import catboost - from . import lightgbm - from . import onnxmlir - from . import detectron - from . import diffusers - from . import tensorflow - from . import statsmodels - from . import torchscript - from . import transformers - from . import tensorflow_v1 - from . import picklable_model - from . import pytorch_lightning + from . import ( + catboost, + detectron, + diffusers, + easyocr, + fastai, + flax, + gluon, + h2o, + keras, + lightgbm, + mlflow, + onnx, + onnxmlir, + paddle, + picklable_model, + pycaret, + pytorch, + pytorch_lightning, + ray, + sklearn, + spacy, + statsmodels, + tensorflow, + tensorflow_v1, + torchscript, + transformers, + triton, + xgboost, + ) # isort: off from . import io @@ -169,6 +167,7 @@ "Runner", "Runnable", "monitoring", + "Strategy", "YataiClient", # Yatai REST API Client # bento APIs "list",