Skip to content

Commit

Permalink
removed duplicates in data (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrjain1312 authored Mar 11, 2024
1 parent 1051319 commit b5f441c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions uptrain/framework/evalllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,12 @@ def evaluate_experiments(
all_cols = set(results.columns)
value_cols = list(all_cols - set([schema.question] + exp_columns))
index_cols = metadata.get("uptrain_index_columns", [schema.question])
if sum(results.is_duplicated()) > 1:
logger.info("Duplicates found in data: Removing duplicates")
results = results.unique()
exp_results = results.pivot(
values=value_cols, index=index_cols, columns=exp_columns
)
values=value_cols, index=index_cols, columns=exp_columns
)
exp_results = exp_results.to_dicts()
return exp_results

Expand Down

0 comments on commit b5f441c

Please sign in to comment.