Spaces:
Running
Running
Download scripts/refresh_forecast_snapshots.py from ThinkcatLab/LiveHouse-TS: direct link, hf CLI and curl.
- Browser
- Download file 949 Bytes
-
https://huggingface.co/spaces/ThinkcatLab/LiveHouse-TS/resolve/main/scripts/refresh_forecast_snapshots.py
- Command line
-
hf download hf://spaces/ThinkcatLab/LiveHouse-TS/scripts/refresh_forecast_snapshots.py
-
curl -L -o refresh_forecast_snapshots.py https://huggingface.co/spaces/ThinkcatLab/LiveHouse-TS/resolve/main/scripts/refresh_forecast_snapshots.py
949 Bytes
| #!/usr/bin/env python3 | |
| """Rebuild public plots from frozen forecasts and locally collected observations.""" | |
| from __future__ import annotations | |
| import argparse | |
| from pathlib import Path | |
| import sys | |
| ROOT = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(ROOT / "src")) | |
| def main(): | |
| from tsfm_bench.data.registry import load_data_source | |
| from tsfm_bench.eval.prequential import PrequentialStore | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--results", type=Path, default=ROOT / "space/results") | |
| parser.add_argument("--config", type=Path, default=ROOT / "configs/datasets/ts_bench.yaml") | |
| args = parser.parse_args() | |
| source = load_data_source(args.config) | |
| count = PrequentialStore(args.results).refresh_public_snapshots(source, source.list_datasets()) | |
| print(f"Updated {count} public snapshots; frozen predictions and scores unchanged.") | |
| if __name__ == "__main__": | |
| main() | |