Skip to content

Commit

Permalink
Fix filepath in raft-ann-bench/split_groundtruth module (#1911)
Browse files Browse the repository at this point in the history
Authors:
  - Divye Gala (https://github.com/divyegala)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #1911
  • Loading branch information
divyegala authored Oct 19, 2023
1 parent b5e14e1 commit 747f6a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion python/raft-ann-bench/src/raft-ann-bench/run/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,15 @@ 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)

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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 747f6a6

Please sign in to comment.