Skip to content

Commit 6697ed1

Browse files
Vaghinak BasentsyanVaghinak Basentsyan
authored andcommitted
Merge remote-tracking branch 'origin/re-design-sdk' into re-design-sdk
2 parents fe23e8d + b7eb1ef commit 6697ed1

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,18 @@ def stop_model_training(model):
26972697
:return: the metadata of the now, stopped model
26982698
:rtype: dict
26992699
"""
2700-
response = controller.stop_model_training(model["id"])
2700+
2701+
model_id = None
2702+
if isinstance(model, dict):
2703+
model_id = model['id']
2704+
else:
2705+
res = controller.search_models(name=model).data
2706+
if len(res):
2707+
model_id = res[0]['id']
2708+
else:
2709+
raise AppException("Model not found.")
2710+
2711+
response = controller.stop_model_training(model_id=model_id)
27012712

27022713
if not response.errors:
27032714
logger.info("Stopped model training")

src/superannotate/lib/infrastructure/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class SuperannotateBackendService(BaseBackendService):
158158
URL_GET_TEMPLATES = "templates"
159159
URL_PROJECT_WORKFLOW_ATTRIBUTE = "project/{}/workflow_attribute"
160160
URL_MODELS = "ml_models"
161-
URL_STOP_MODEL_TRAINING = "ml_models/{}/stopTrainingJob"
161+
URL_STOP_MODEL_TRAINING = "ml_model/{}/stopTrainingJob"
162162
URL_GET_MODEL_METRICS = "ml_models/{}/getCurrentMetrics"
163163
URL_BULK_GET_FOLDERS = "foldersByTeam"
164164
URL_GET_EXPORT = "export/{}"

0 commit comments

Comments
 (0)