Skip to content

Commit

Permalink
Auto-update of Starter template
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 21, 2024
1 parent 145b90b commit 1e1991a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/mlops_starter/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 2024.09.24
_commit: 2024.10.21
_src_path: gh:zenml-io/template-starter
email: [email protected]
full_name: ZenML GmbH
Expand Down
4 changes: 2 additions & 2 deletions examples/mlops_starter/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -994,8 +994,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",
Expand Down
4 changes: 2 additions & 2 deletions examples/mlops_starter/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def main(
# 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
]
target = preprocess_pipeline_artifact.run_metadata["target"]
run_args_inference["random_state"] = random_state
run_args_inference["target"] = target

Expand Down
8 changes: 3 additions & 5 deletions examples/mlops_starter/steps/model_promoter.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ def model_promoter(accuracy: float, stage: str = "production") -> bool:
try:
stage_model = client.get_model_version(current_model.name, stage)
# We compare their metrics
prod_accuracy = (
stage_model.get_artifact("sklearn_classifier")
.run_metadata["test_accuracy"]
.value
)
prod_accuracy = stage_model.get_artifact(
"sklearn_classifier"
).run_metadata["test_accuracy"]
if float(accuracy) > float(prod_accuracy):
# If current model has better metrics, we promote it
is_promoted = True
Expand Down

0 comments on commit 1e1991a

Please sign in to comment.