Skip to content

Commit 1734198

Browse files
authored
Fix issue where old model was being reused instead of the new one (#205)
`predict_wrapper` references the global variable `loaded_model` which was never being updated, meaning that mlflow.genai.evaluate was not executed with the intended model
1 parent 7f126a9 commit 1734198

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

product_demos/Data-Science/ai-agent/02-agent-eval/02.1_agent_evaluation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ def get_scorers():
281281

282282
# COMMAND ----------
283283

284+
# Load the model to be used in evaluation via `predict_wrapper`
285+
loaded_model = mlflow.pyfunc.load_model(f"runs:/{logged_agent_info.run_id}/agent")
286+
284287
with mlflow.start_run(run_name='eval_with_reasoning_instructions'):
285288
results = mlflow.genai.evaluate(data=eval_dataset, predict_fn=predict_wrapper, scorers=scorers)
286289

0 commit comments

Comments
 (0)