Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
aakrem committed Jan 4, 2024
1 parent 134556a commit 9ea844a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions agenta-backend/agenta_backend/services/evaluation_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,6 @@ async def compare_evaluations_scenarios(
)
all_scenarios.append(eval_scenarios)


groupped_scenarios_by_inputs = find_scenarios_by_input(
formatted_inputs, all_scenarios
)
Expand All @@ -1077,15 +1076,17 @@ def extract_inputs_values_from_testset(testset):

for entry in testset:
for key in input_keys:
if key != 'correct_answer':
if key != "correct_answer":
extracted_values.append({"input_name": key, "input_value": entry[key]})

return extracted_values


def find_scenarios_by_input(formatted_inputs, all_scenarios):
results = []
flattened_scenarios = [scenario for sublist in all_scenarios for scenario in sublist]
flattened_scenarios = [
scenario for sublist in all_scenarios for scenario in sublist
]

for formatted_input in formatted_inputs:
input_name = formatted_input["input_name"]
Expand All @@ -1110,7 +1111,7 @@ def find_scenarios_by_input(formatted_inputs, all_scenarios):

return {
"inputs": formatted_inputs,
"data" : results,
"data": results,
}


Expand All @@ -1124,4 +1125,4 @@ def remove_duplicates(csvdata):
unique_data.add(entry_tuple)
unique_entries.append(entry)

return unique_entries
return unique_entries

0 comments on commit 9ea844a

Please sign in to comment.