File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff 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" )
Original file line number Diff line number Diff 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/{}"
You can’t perform that action at this time.
0 commit comments