data(train 520·holdout 120), server(발화 생성 서버), eval(grounding_eval), run_eval.py·run_test.sh. logs/ 는 실행 때마다 생기는 기록이라 README.md 만 올리고 나머지는 .gitignore 로 뺀다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
779 B
Python
29 lines
779 B
Python
"""config.toml 로더 — 파일이 없으면 기본값으로 기동한다.
|
|
|
|
GROUNDING_AGENT_CONFIG 환경변수로 다른 설정 파일을 지정할 수 있다 (테스트가 증빙 로그 폴더에 쓰지 않게 할 때 등).
|
|
"""
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
from common.paths import SERVER_ROOT
|
|
from config.config_models import AppConfig
|
|
|
|
try:
|
|
import tomllib # Python 3.11+
|
|
except ImportError:
|
|
import tomli as tomllib # Python 3.10 (평가환경)
|
|
|
|
CONFIG_PATH = Path(os.getenv("GROUNDING_AGENT_CONFIG") or SERVER_ROOT / "config.toml")
|
|
|
|
|
|
def load_config() -> AppConfig:
|
|
if CONFIG_PATH.exists():
|
|
with open(CONFIG_PATH, "rb") as f:
|
|
raw = tomllib.load(f)
|
|
return AppConfig(**raw)
|
|
return AppConfig()
|
|
|
|
|
|
app_config = load_config()
|