From acb4f47e63bfb783bbd77751158bb3b26d048571 Mon Sep 17 00:00:00 2001 From: AlexejPenner Date: Mon, 21 Oct 2024 08:32:45 +0200 Subject: [PATCH] Adjust to https://github.com/zenml-io/zenml/pull/3096 --- template/quickstart.ipynb | 4 ++-- template/run.py | 4 ++-- template/steps/model_promoter.py | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/template/quickstart.ipynb b/template/quickstart.ipynb index f2f09be..8c57318 100644 --- a/template/quickstart.ipynb +++ b/template/quickstart.ipynb @@ -982,8 +982,8 @@ "@pipeline\n", "def inference(preprocess_pipeline_id: UUID):\n", " \"\"\"Model batch inference pipeline\"\"\"\n", - " # random_state = client.get_artifact_version(name_id_or_prefix=preprocess_pipeline_id).metadata[\"random_state\"].value\n", - " # target = client.get_artifact_version(name_id_or_prefix=preprocess_pipeline_id).run_metadata['target'].value\n", + " # random_state = client.get_artifact_version(name_id_or_prefix=preprocess_pipeline_id).metadata[\"random_state\"]\n", + " # target = client.get_artifact_version(name_id_or_prefix=preprocess_pipeline_id).run_metadata['target']\n", " random_state = 42\n", " target = \"target\"\n", "\n", diff --git a/template/run.py b/template/run.py index 539ddd0..91ba876 100644 --- a/template/run.py +++ b/template/run.py @@ -207,8 +207,8 @@ def main( # Use the metadata of feature engineering pipeline artifact # to get the random state and target column - random_state = preprocess_pipeline_artifact.run_metadata["random_state"].value - target = preprocess_pipeline_artifact.run_metadata["target"].value + random_state = preprocess_pipeline_artifact.run_metadata["random_state"] + target = preprocess_pipeline_artifact.run_metadata["target"] run_args_inference["random_state"] = random_state run_args_inference["target"] = target diff --git a/template/steps/model_promoter.py b/template/steps/model_promoter.py index 1cdbf9a..d24b9b0 100644 --- a/template/steps/model_promoter.py +++ b/template/steps/model_promoter.py @@ -48,7 +48,6 @@ def model_promoter(accuracy: float, stage: str = "production") -> bool: prod_accuracy = ( stage_model.get_artifact("sklearn_classifier") .run_metadata["test_accuracy"] - .value ) if float(accuracy) > float(prod_accuracy): # If current model has better metrics, we promote it