From 70a3431e71253a050421fb606f6f838027576c03 Mon Sep 17 00:00:00 2001 From: Charles Zaloom Date: Mon, 26 Aug 2024 10:29:41 -0500 Subject: [PATCH] patched filter creation --- 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 85106a7b1..22b926822 100644 --- a/api/valor_api/backend/core/evaluation.py +++ b/api/valor_api/backend/core/evaluation.py @@ -376,13 +376,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: