Views
No views yet
http://localhost:9090docker-compose up1$ curl http://localhost:9090/health
2{"status":"UP"}my_training_module.py and my_inference_module.pyrequirements.txtwsgi.py and make your configurations under init_model_server arguments:1from my_training_module import training_script
2from my_inference_module import InferenceModel
3
4init_model_server(
5 create_model_func=InferenceModel,
6 train_script=training_script,
7 ...docker-compose up --build1from htx.base_model import BaseModel
2
3# use BaseModel inheritance provided by pyheartex SDK
4class MyModel(BaseModel):
5
6 # Describe input types (AIxBlockobject tags names)
7 INPUT_TYPES = ('Image',)
8
9 # Describe output types (AIxBlockcontrol tags names)
10 INPUT_TYPES = ('Choices',)
11
12 def load(self, resources, **kwargs):
13 """Here you load the model into the memory. resources is a dict returned by training script"""
14 self.model_path = resources["model_path"]
15 self.labels = resources["labels"]
16
17 def predict(self, tasks, **kwargs):
18 """Here you create list of model results with Label Studio's prediction format, task by task"""
19 predictions = []
20 for task in tasks:
21 # do inference...
22 predictions.append(task_prediction)
23 return predictionsload() function in inference module.1def train(input_iterator, working_dir, **kwargs):
2 """Here you gather input examples and output labels and train your model"""
3 resources = {"model_path": "some/model/path", "labels": ["aaa", "bbb", "ccc"]}
4 return resources