From b743f328207b53a66bbc4b2157629654e720d09d Mon Sep 17 00:00:00 2001 From: clementjumel Date: Wed, 20 Dec 2023 14:40:48 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(Spider):=20introduce=20mo?= =?UTF-8?q?re=20=5Fpath=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/spider/spider/_path.py | 3 +++ lib/spider/spider/in_context_learning.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/spider/spider/_path.py b/lib/spider/spider/_path.py index fd55e66..0102811 100644 --- a/lib/spider/spider/_path.py +++ b/lib/spider/spider/_path.py @@ -1,4 +1,7 @@ from pathlib import Path _ROOT = Path(__file__).parent.parent + +ENV_FILE_PATH = _ROOT / ".env" DATASET_PATH = _ROOT / "data" / "spider" +CONFIG_PATH = _ROOT / "configs" diff --git a/lib/spider/spider/in_context_learning.py b/lib/spider/spider/in_context_learning.py index a95d12b..e337755 100644 --- a/lib/spider/spider/in_context_learning.py +++ b/lib/spider/spider/in_context_learning.py @@ -20,7 +20,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer from wandb import wandb_run -from spider._path import _ROOT, DATASET_PATH +from spider._path import CONFIG_PATH, DATASET_PATH, ENV_FILE_PATH from spider.clearml_utils import setup_clearml from spider.evaluation import build_foreign_key_map_from_json, evaluate from spider.utils import extract_sql, is_valid_sql @@ -34,11 +34,11 @@ table = DATASET_PATH / "tables.json" -@hydra.main(version_base="1.3", config_path=str(_ROOT / "configs"), config_name="eval.yaml") +@hydra.main(version_base="1.3", config_path=str(CONFIG_PATH), config_name="eval.yaml") def main(cfg) -> None: transformers.set_seed(cfg.seed) # loggers - setup_clearml(env_file_path=_ROOT / ".env") + setup_clearml(env_file_path=ENV_FILE_PATH / ".env") task = Task.init( project_name="spider", task_name="vanilla_llm",