diff --git a/trustllm_pkg/trustllm/utils/metrics.py b/trustllm_pkg/trustllm/utils/metrics.py index a1d4e63..d57945f 100644 --- a/trustllm_pkg/trustllm/utils/metrics.py +++ b/trustllm_pkg/trustllm/utils/metrics.py @@ -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):