Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove .value from metadata access #25

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions template/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions template/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion template/steps/model_promoter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading