diff --git a/python/raft-ann-bench/src/raft-ann-bench/run/__main__.py b/python/raft-ann-bench/src/raft-ann-bench/run/__main__.py index 3b670dc464..a0d4fabb77 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/run/__main__.py +++ b/python/raft-ann-bench/src/raft-ann-bench/run/__main__.py @@ -239,7 +239,6 @@ def main(): ) conf_filename = conf_filepath.split("/")[-1] conf_filedir = "/".join(conf_filepath.split("/")[:-1]) - dataset_name = conf_filename.replace(".json", "") dataset_path = args.dataset_path if not os.path.exists(conf_filepath): raise FileNotFoundError(conf_filename) @@ -247,6 +246,8 @@ def main(): with open(conf_filepath, "r") as f: conf_file = json.load(f) + dataset_name = conf_file["dataset"]["name"] + executables_to_run = dict() # At least one named index should exist in config file if args.indices: diff --git a/python/raft-ann-bench/src/raft-ann-bench/split_groundtruth/__main__.py b/python/raft-ann-bench/src/raft-ann-bench/split_groundtruth/__main__.py index e8625ce7d7..b886d40ea7 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/split_groundtruth/__main__.py +++ b/python/raft-ann-bench/src/raft-ann-bench/split_groundtruth/__main__.py @@ -19,10 +19,14 @@ def split_groundtruth(groundtruth_filepath): - ann_bench_scripts_path = "split_groundtruth.pl" + ann_bench_scripts_path = os.path.join( + os.path.dirname(os.path.realpath(__file__)), "split_groundtruth.pl" + ) pwd = os.getcwd() - os.chdir("/".join(groundtruth_filepath.split("/")[:-1])) - groundtruth_filename = groundtruth_filepath.split("/")[-1] + path_to_groundtruth = os.path.normpath(groundtruth_filepath).split(os.sep) + if len(path_to_groundtruth) > 1: + os.chdir(os.path.join(*path_to_groundtruth[:-1])) + groundtruth_filename = path_to_groundtruth[-1] subprocess.run( [ann_bench_scripts_path, groundtruth_filename, "groundtruth"], check=True,