From 80b94aecb2079c88bad6b3164f7c13e58124a52a Mon Sep 17 00:00:00 2001 From: potassiummmm Date: Thu, 31 Oct 2024 16:50:47 +0800 Subject: [PATCH] Fix llama-bench path error on Windows --- utils/e2e_benchmark.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/e2e_benchmark.py b/utils/e2e_benchmark.py index 4789aac..07f93ed 100644 --- a/utils/e2e_benchmark.py +++ b/utils/e2e_benchmark.py @@ -2,6 +2,7 @@ import os import sys import logging import argparse +import platform import subprocess def run_command(command, shell=False, log_step=None): @@ -22,7 +23,13 @@ def run_command(command, shell=False, log_step=None): sys.exit(1) def run_benchmark(): - bench_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "build/bin/llama-bench") + build_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "build") + if platform.system() == "Windows": + bench_path = os.path.join(build_dir, "bin", "Release", "llama-bench.exe") + if not os.path.exists(bench_path): + bench_path = os.path.join(build_dir, "bin", "llama-bench") + else: + bench_path = os.path.join(build_dir, "bin", "llama-bench") if not os.path.exists(bench_path): logging.error(f"Benchmark binary not found, please build first.") sys.exit(1)