From 1b8491153c4e951b7203cd00f7c972af13f3683c Mon Sep 17 00:00:00 2001 From: "Jun Siang Cheah (aider)" Date: Sun, 1 Sep 2024 23:19:27 +0100 Subject: [PATCH] refactor: make README file paths relative to script directory --- src/pull_available_models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pull_available_models.py b/src/pull_available_models.py index 1c1e761..ebb92f4 100644 --- a/src/pull_available_models.py +++ b/src/pull_available_models.py @@ -595,9 +595,10 @@ def main(): print("Missing models:") print(list(MISSING_MODELS)) - with open("README_template.md", "r") as f: + script_dir = os.path.dirname(os.path.abspath(__file__)) + with open(os.path.join(script_dir, "README_template.md"), "r") as f: readme = f.read() - with open("../README.md", "w") as f: + with open(os.path.join(script_dir, "..", "README.md"), "w") as f: f.write(readme.replace("{{MODEL_LIST}}", table).replace("{{TRIAL_MODEL_LIST}}", trial_table)) print("Wrote models to README.md")