Skip to content

Commit

Permalink
♻️ (Spider): introduce more _path variables
Browse files Browse the repository at this point in the history
  • Loading branch information
clementjumel committed Dec 20, 2023
1 parent 744ea61 commit b743f32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/spider/spider/_path.py
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 3 additions & 3 deletions lib/spider/spider/in_context_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down

0 comments on commit b743f32

Please sign in to comment.