Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieHwong committed Apr 21, 2024
1 parent e680cf7 commit c6465d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion trustllm_pkg/trustllm/utils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def calculate_toxicity(data, key='toxicity'):
average = sum(values) / len(values)
maximum = max(values)

return average, maximum
return {
"average_toxicity": average,
"max_toxicity": maximum
}


def is_chinese_ratio(text, ratio):
Expand Down

0 comments on commit c6465d3

Please sign in to comment.