File tree Expand file tree Collapse file tree 5 files changed +15
-1
lines changed
Expand file tree Collapse file tree 5 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,6 @@ def log_tags(run_id: str) -> None:
1515 if not k .startswith ("mlflow." ) and k != RUN_TYPE_TAG_NAME
1616 }
1717 )
18+ run_type = run .data .tags .get (RUN_TYPE_TAG_NAME , None )
19+ if run_type is not None :
20+ mlflow .set_tag (f"{ run_type } _run_id" , run_id )
Original file line number Diff line number Diff line change 2323
2424from modelplane .mlflow .loghelpers import log_tags
2525from modelplane .runways .utils import (
26+ MODELGAUGE_RUN_TAG_NAME ,
2627 PROMPT_RESPONSE_ARTIFACT_NAME ,
2728 RUN_TYPE_ANNOTATOR ,
2829 RUN_TYPE_TAG_NAME ,
@@ -113,6 +114,7 @@ def annotate(
113114 pipeline_runner .run (
114115 progress_callback = mlflow .log_metrics , debug = is_debug_mode ()
115116 )
117+ mlflow .set_tag (MODELGAUGE_RUN_TAG_NAME , pipeline_runner .run_id )
116118
117119 # log the output to mlflow's artifact store
118120 mlflow .log_artifact (
Original file line number Diff line number Diff line change 99from modelgauge .sut_registry import SUTS
1010
1111from modelplane .runways .utils import (
12+ MODELGAUGE_RUN_TAG_NAME ,
1213 RUN_TYPE_RESPONDER ,
1314 RUN_TYPE_TAG_NAME ,
1415 get_experiment_id ,
@@ -53,6 +54,7 @@ def respond(
5354 pipeline_runner .run (
5455 progress_callback = mlflow .log_metrics , debug = is_debug_mode ()
5556 )
57+ mlflow .set_tag (MODELGAUGE_RUN_TAG_NAME , pipeline_runner .run_id )
5658
5759 # log the output to mlflow's artifact store
5860 mlflow .log_artifact (
Original file line number Diff line number Diff line change 11"""Runway for measuring annotations against ground truth."""
22
33import json
4+ import math
45import os
56import tempfile
67from pathlib import Path
@@ -63,7 +64,12 @@ def score(
6364 for annotator in annotators :
6465 score = score_annotator (annotator , annotations_df , ground_truth_df )
6566 for metric in score :
66- mlflow .log_metric (f"{ annotator } _{ metric } " , score [metric ])
67+ if math .isnan (score [metric ]):
68+ mlflow .log_metric (f"{ annotator } _{ metric } _is_nan" , 1.0 )
69+ elif math .isinf (score [metric ]):
70+ mlflow .log_metric (f"{ annotator } _{ metric } _is_inf" , 1.0 )
71+ else :
72+ mlflow .log_metric (f"{ annotator } _{ metric } " , score [metric ])
6773
6874 return run .info .run_id
6975
Original file line number Diff line number Diff line change 2121RUN_TYPE_RESPONDER = "get-sut-responses"
2222RUN_TYPE_ANNOTATOR = "annotate"
2323RUN_TYPE_SCORER = "score"
24+ MODELGAUGE_RUN_TAG_NAME = "modelgauge_run_id"
2425
2526
2627def is_debug_mode () -> bool :
You can’t perform that action at this time.
0 commit comments