Skip to content

Commit

Permalink
putting in logic to set the metrics when the model changes
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Apr 1, 2024
1 parent 1df7e48 commit 6e01b8b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/sageworks/web_components/model_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ def register_callbacks(self, model_table):
Output(f"{self.prefix_id}-summary", "children"),
Output(f"{self.prefix_id}-dropdown", "options"),
Output(f"{self.prefix_id}-dropdown", "value"),
Output(f"{self.prefix_id}-metrics", "children", allow_duplicate=True),
],
Input(model_table, "derived_viewport_selected_row_ids"),
State(model_table, "data"),
prevent_initial_call=True,
)
def update_model(selected_rows, table_data):
# Check for no selected rows
Expand All @@ -66,11 +68,16 @@ def update_model(selected_rows, table_data):
# Populate the inference runs dropdown
inference_runs, default_run = self.get_inference_runs()

return header, summary, inference_runs, default_run
# Update the metrics for the default inference run
metrics = self.inference_metrics(default_run)

# Return the updated components
return header, summary, inference_runs, default_run, metrics

@callback(
Output(f"{self.prefix_id}-metrics", "children"),
Output(f"{self.prefix_id}-metrics", "children", allow_duplicate=True),
Input(f"{self.prefix_id}-dropdown", "value"),
prevent_initial_call=True,
)
def update_inference_run(inference_run):
# Check for no inference run
Expand Down

0 comments on commit 6e01b8b

Please sign in to comment.