From 8b21921f134f5d8c32ccc2983b8da1e59cb35254 Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 18 Oct 2023 15:49:59 -0700 Subject: [PATCH] fix issue with local path --- .../src/raft-ann-bench/split_groundtruth/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 e174e36390..4e0e127db4 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 @@ -23,7 +23,9 @@ def split_groundtruth(groundtruth_filepath): os.path.dirname(os.path.realpath(__file__)), "split_groundtruth.pl" ) pwd = os.getcwd() - os.chdir("/".join(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)) groundtruth_filename = groundtruth_filepath.split("/")[-1] subprocess.run( [ann_bench_scripts_path, groundtruth_filename, "groundtruth"],