Skip to content

Commit

Permalink
patched filter creation
Browse files Browse the repository at this point in the history
  • Loading branch information
czaloom committed Aug 26, 2024
1 parent 01b92a8 commit 70a3431
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions api/valor_api/backend/core/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 70a3431

Please sign in to comment.