Skip to content

Commit 3290905

Browse files
committed
Fixed config loading
1 parent dabdc7c commit 3290905

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

main.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
from benchmark import run_benchmarks
99

1010
def main():
11-
# Get the root directory (parent of the current script's directory)
12-
script_dir = os.path.dirname(os.path.abspath(__file__))
13-
root_dir = os.path.dirname(script_dir)
14-
config_path = os.path.join(root_dir, "config.yml")
11+
# Load config from current working directory (where user runs the command)
12+
config_path = os.path.join(os.getcwd(), "config.yml")
1513

1614
if not os.path.exists(config_path):
17-
print(f"config.yml not found in root directory: {config_path}")
15+
print(f"config.yml not found in current directory: {config_path}")
16+
print("Please make sure config.yml is in the directory where you run 'benchtool'")
1817
sys.exit(1)
1918

2019
with open(config_path, "r") as f:
@@ -28,9 +27,9 @@ def main():
2827
input_config = config.get("input", {})
2928
if input_config.get("mode") == "csv":
3029
csv_path = input_config["csv"]["path"]
31-
# If the path is not absolute, resolve it relative to the root directory
30+
# If the path is not absolute, resolve it relative to the current working directory
3231
if not os.path.isabs(csv_path):
33-
csv_path = os.path.join(root_dir, csv_path)
32+
csv_path = os.path.join(os.getcwd(), csv_path)
3433
input_config["csv"]["path"] = csv_path
3534
note_texts = load_notes(input_config) # This loads the notes based on config (CSV mode)
3635

0 commit comments

Comments
 (0)