From 636c6c401b6d80326a0ee1d67dfbc97be87571a6 Mon Sep 17 00:00:00 2001 From: Akrem Abayed Date: Thu, 4 Jan 2024 18:31:05 +0100 Subject: [PATCH] fix evaluations scenarios --- .../agenta_backend/tasks/evaluations.py | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/agenta-backend/agenta_backend/tasks/evaluations.py b/agenta-backend/agenta_backend/tasks/evaluations.py index 28f5ca7c84..a5a3970ecc 100644 --- a/agenta-backend/agenta_backend/tasks/evaluations.py +++ b/agenta-backend/agenta_backend/tasks/evaluations.py @@ -122,24 +122,25 @@ def evaluate( result ) - # 4. We create a new evaluation scenario - evaluation_scenario = loop.run_until_complete( - create_new_evaluation_scenario( - user=app.user, - organization=app.organization, - evaluation=new_evaluation_db, - variant_id=variant_id, - evaluators_configs=new_evaluation_db.evaluators_configs, - inputs=inputs, - is_pinned=False, - note="", - correct_answer=data_point["correct_answer"], - outputs=[ - EvaluationScenarioOutputDB(type="text", value=app_output.output) - ], - results=evaluators_results, + # 4. We create a new evaluation scenario + evaluation_scenario = loop.run_until_complete( + create_new_evaluation_scenario( + user=app.user, + organization=app.organization, + evaluation=new_evaluation_db, + variant_id=variant_id, + evaluators_configs=new_evaluation_db.evaluators_configs, + inputs=inputs, + is_pinned=False, + note="", + correct_answer=data_point["correct_answer"], + outputs=[ + EvaluationScenarioOutputDB(type="text", value=app_output.output) + ], + results=evaluators_results, + ) ) - ) + except Exception as e: print(f"An error occurred during evaluation: {e}") loop.run_until_complete(