From 09232370fc6426aa5dd9be01a8271b9c28f5af3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Sun, 11 May 2025 16:20:39 +0200 Subject: [PATCH] scripts : exit compare-llama-bench.py gracefully when there's nothing to compare (#13451) --- scripts/compare-llama-bench.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/compare-llama-bench.py b/scripts/compare-llama-bench.py index 8c599cf9e..c32b449f7 100755 --- a/scripts/compare-llama-bench.py +++ b/scripts/compare-llama-bench.py @@ -318,7 +318,7 @@ else: show = [] # Show CPU and/or GPU by default even if the hardware for all results is the same: - if "n_gpu_layers" not in properties_different: + if rows_full and "n_gpu_layers" not in properties_different: ngl = int(rows_full[0][KEY_PROPERTIES.index("n_gpu_layers")]) if ngl != 99 and "cpu_info" not in properties_different: @@ -338,6 +338,10 @@ else: pass rows_show = get_rows(show) +if not rows_show: + logger.error(f"No comparable data was found between {name_baseline} and {name_compare}.\n") + sys.exit(1) + table = [] for row in rows_show: n_prompt = int(row[-5])