This repository was archived by the owner on Apr 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 2020import os
2121from typing import Optional , Dict , Any
2222from cortex .serviceconnector import _Client
23+
2324try :
2425 import mlflow
2526except ImportError :
2627 mlflow = None
2728
2829
2930def check_installed ():
31+ """
32+ Checks if the model SDK extra is installed
33+ :return:
34+ """
3035 if mlflow is None :
3136 raise NotImplementedError (
3237 'Models SDK extra not installed, please run `pip install cortex-python[models_sdk]` to install' )
3338
39+
3440class ModelClient (_Client ):
3541 """
3642 Client for model registry, this class requires the `models_sdk` extras to be installed
3743 """
44+
3845 def __init__ (self , * args , ** kwargs ):
3946 super ().__init__ (* args , ** kwargs )
4047 # Setup model registry by default
4148 self ._setup_model_client ()
4249
4350 def _setup_model_client (self ):
4451 # Generate a JWT, this call stores the JWT in `_serviceconnector.jwt` ( meh )
45- self ._serviceconnector ._construct_headers ({}) # pylint: disable=protected-access
52+ self ._serviceconnector ._construct_headers ({}) # pylint: disable=protected-access
4653
4754 mlflow .set_tracking_uri (self ._serviceconnector .url )
4855 os .environ ['MLFLOW_TRACKING_URI' ] = self ._serviceconnector .url
You can’t perform that action at this time.
0 commit comments