From 74df1f6469ac7af92ed0da2e7564a851ee263375 Mon Sep 17 00:00:00 2001 From: CoderMayhem Date: Tue, 12 Mar 2024 14:23:13 +0530 Subject: [PATCH] fix division by zero err in html report generation --- garak/analyze/report_digest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/garak/analyze/report_digest.py b/garak/analyze/report_digest.py index 37c20b233..08726b20c 100644 --- a/garak/analyze/report_digest.py +++ b/garak/analyze/report_digest.py @@ -100,7 +100,7 @@ def compile_digest(report_path, taxonomy=_config.reporting.taxonomy): eval["probe"] = eval["probe"].replace("probes.", "") pm, pc = eval["probe"].split(".") detector = eval["detector"].replace("detector.", "") - score = eval["passed"] / eval["total"] + score = eval["passed"] / eval["total"] if eval["total"] else 0 instances = eval["total"] groups = [] if taxonomy is not None: