diff --git a/python/hsml/connection.py b/python/hsml/connection.py index c162a0a9f..899589a4e 100644 --- a/python/hsml/connection.py +++ b/python/hsml/connection.py @@ -16,8 +16,6 @@ import os -from hsml import client -from hsml.core import model_api, model_registry_api, model_serving_api from hsml.decorators import connected, not_connected from requests.exceptions import ConnectionError @@ -98,6 +96,7 @@ def __init__( api_key_file: str = None, api_key_value: str = None, ): + from hsml.core import model_api, model_registry_api, model_serving_api self._host = host self._port = port self._project = project @@ -162,6 +161,8 @@ def connect(self): conn.connect() ``` """ + from hsml import client + from hsml.core import model_api self._connected = True try: # init client @@ -194,6 +195,7 @@ def close(self): Usage is recommended but optional. """ + from hsml import client client.stop() self._model_api = None self._connected = False diff --git a/python/hsml/model_registry.py b/python/hsml/model_registry.py index 4a7f3443b..91647ed67 100644 --- a/python/hsml/model_registry.py +++ b/python/hsml/model_registry.py @@ -19,10 +19,10 @@ import humps from hsml import util from hsml.core import model_api -from hsml.python import signature as python_signature # noqa: F401 from hsml.sklearn import signature as sklearn_signature # noqa: F401 from hsml.tensorflow import signature as tensorflow_signature # noqa: F401 from hsml.torch import signature as torch_signature # noqa: F401 +from python.hsml.python import signature as python_signature # noqa: F401 class ModelRegistry: diff --git a/python/hsml/python/signature.py b/python/hsml/python/signature.py index 94b154abf..e7c4d4ca9 100644 --- a/python/hsml/python/signature.py +++ b/python/hsml/python/signature.py @@ -19,7 +19,7 @@ import numpy import pandas from hsml.model_schema import ModelSchema -from hsml.python.model import Model +from python.hsml.python.model import Model _mr = None