From 82178dc767cfc73cc50704ec45007a17aa4eca94 Mon Sep 17 00:00:00 2001 From: NolanB <nboukachab@teklia.com> Date: Tue, 30 Aug 2022 12:51:01 +0200 Subject: [PATCH] Add logs --- arkindex_worker/worker/training.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arkindex_worker/worker/training.py b/arkindex_worker/worker/training.py index 2501e0eb..00dbd09e 100644 --- a/arkindex_worker/worker/training.py +++ b/arkindex_worker/worker/training.py @@ -158,6 +158,8 @@ class TrainingMixin(object): logger.error(model_version_details[0]) return + model_version_id = model_version_details.get("id") + logger.info(f"Model version{model_version_id} was created successfully") return model_version_details def upload_to_s3(self, archive_path: str, model_version_details: dict) -> None: @@ -185,11 +187,12 @@ class TrainingMixin(object): Update the specified model version to the state `Available` and use the given information" """ - logger.info("Updating the model version...") + model_version_id = model_version_details.get("id") + logger.info(f"Updating the model version {model_version_id}") try: self.request( "UpdateModelVersion", - id=model_version_details.get("id"), + id=model_version_id, body={ "state": "available", "description": model_version_details.get("description"), @@ -197,5 +200,6 @@ class TrainingMixin(object): "tag": model_version_details.get("tag"), }, ) + logger.info(f"Model version{model_version_id} successfully updated") except ErrorResponse as e: logger.error(f"Failed to update model version: {e.content}") -- GitLab