Skip to content

Commit

Permalink
Fix docgen
Browse files Browse the repository at this point in the history
There is a very strange bug: hsml.python for some reason is available only as python.hsml.python.
  • Loading branch information
aversey committed Jul 16, 2024
1 parent d2c9a1c commit d1ac93f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions python/hsml/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/hsml/model_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion python/hsml/python/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d1ac93f

Please sign in to comment.