Skip to content

Commit 0923237

Browse files
authored
scripts : exit compare-llama-bench.py gracefully when there's nothing to compare (#13451)
1 parent 7474e00 commit 0923237

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/compare-llama-bench.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def get_rows(properties):
318318

319319
show = []
320320
# Show CPU and/or GPU by default even if the hardware for all results is the same:
321-
if "n_gpu_layers" not in properties_different:
321+
if rows_full and "n_gpu_layers" not in properties_different:
322322
ngl = int(rows_full[0][KEY_PROPERTIES.index("n_gpu_layers")])
323323

324324
if ngl != 99 and "cpu_info" not in properties_different:
@@ -338,6 +338,10 @@ def get_rows(properties):
338338
pass
339339
rows_show = get_rows(show)
340340

341+
if not rows_show:
342+
logger.error(f"No comparable data was found between {name_baseline} and {name_compare}.\n")
343+
sys.exit(1)
344+
341345
table = []
342346
for row in rows_show:
343347
n_prompt = int(row[-5])

0 commit comments

Comments
 (0)