From 7238c8db8820bc7202f2a36aa78e50ed556c8a31 Mon Sep 17 00:00:00 2001 From: Charles Zaloom <38677807+czaloom@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:26:20 -0400 Subject: [PATCH] Evaluation Response Patch (#722) --- api/valor_api/backend/core/evaluation.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/api/valor_api/backend/core/evaluation.py b/api/valor_api/backend/core/evaluation.py index d619fc32f..cad5e5aea 100644 --- a/api/valor_api/backend/core/evaluation.py +++ b/api/valor_api/backend/core/evaluation.py @@ -388,13 +388,17 @@ def _create_responses( parameters = schemas.EvaluationParameters(**evaluation.parameters) kwargs = dict() try: - filters = schemas.Filter(**evaluation.filters) - groundtruth_filter = filters.model_copy() - groundtruth_filter.predictions = None - - prediction_filter = filters.model_copy() - prediction_filter.groundtruths = None + # generate filters + ( + groundtruth_filter, + prediction_filter, + ) = prepare_filter_for_evaluation( + filters=schemas.Filter(**evaluation.filters), + dataset_names=evaluation.dataset_names, + model_name=evaluation.model_name, + task_type=parameters.task_type, + ) match parameters.task_type: case enums.TaskType.CLASSIFICATION: