weather-llm-initial / scripts /eval_prompts.py
NagacharanVemula
Initial code-first model repo publish.
78dea75
Raw
History Blame Contribute Delete
941 Bytes
#!/usr/bin/env python3
"""Run a small qualitative eval suite and write a JSON report."""
from __future__ import annotations
import argparse
import json
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "src"))
from weather_llm.config_loader import repo_root_from
from weather_llm.eval.harness import run_eval_suite, write_report
def main() -> int:
ap = argparse.ArgumentParser()
ap.add_argument("--model_dir", type=Path, required=True)
ap.add_argument("--out", type=Path, default=None)
args = ap.parse_args()
root = repo_root_from(ROOT)
out = args.out or (root / "outputs/eval_report.json")
report = run_eval_suite(args.model_dir.resolve())
write_report(out, report)
print(json.dumps(report, indent=2, ensure_ascii=False))
return 0 if report["passed"] == report["total"] else 1
if __name__ == "__main__":
raise SystemExit(main())