Spaces:
Running
Running
Deploy Space: update src
Browse files- src/utils.py +16 -1
src/utils.py
CHANGED
|
@@ -122,6 +122,17 @@ def load_all_results(root_dir: str = "results") -> pd.DataFrame:
|
|
| 122 |
return pd.DataFrame(columns=RESULT_COLUMNS)
|
| 123 |
df = df.sort_values(by=["model", "dataset"]).reset_index(drop=True)
|
| 124 |
df["model"] = df["model"].replace(LEGACY_MODEL_NAMES)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
parts = df["dataset"].astype(str).str.split("/", expand=True)
|
| 126 |
if parts.shape[1] < 3:
|
| 127 |
for idx in range(parts.shape[1], 3):
|
|
@@ -627,9 +638,10 @@ def _today_start_utc8() -> datetime:
|
|
| 627 |
|
| 628 |
def get_dataset_last_eval_time(ds_base: str, root_dir: str = "results") -> datetime | None:
|
| 629 |
latest_dt: datetime | None = None
|
|
|
|
| 630 |
# Scan model directories
|
| 631 |
for model_dir in Path(root_dir).iterdir():
|
| 632 |
-
if not model_dir.is_dir():
|
| 633 |
continue
|
| 634 |
forecasts_dir = model_dir / "forecasts"
|
| 635 |
if not forecasts_dir.is_dir():
|
|
@@ -708,7 +720,10 @@ def make_domain_pie_chart(root_dir: str = "results") -> object | None:
|
|
| 708 |
# Fallback to current snapshots count if history is empty or fails
|
| 709 |
if not timestamp_counts:
|
| 710 |
seen_datasets: set[str] = set()
|
|
|
|
| 711 |
for model_dir in sorted(Path(root_dir).iterdir()):
|
|
|
|
|
|
|
| 712 |
forecasts_dir = model_dir / "forecasts"
|
| 713 |
if not forecasts_dir.is_dir():
|
| 714 |
continue
|
|
|
|
| 122 |
return pd.DataFrame(columns=RESULT_COLUMNS)
|
| 123 |
df = df.sort_values(by=["model", "dataset"]).reset_index(drop=True)
|
| 124 |
df["model"] = df["model"].replace(LEGACY_MODEL_NAMES)
|
| 125 |
+
|
| 126 |
+
ALLOWED_MODELS = {
|
| 127 |
+
"Toto-2.0-1B",
|
| 128 |
+
"Moirai-1.1-Large",
|
| 129 |
+
"Chronos-2",
|
| 130 |
+
"Timer-S1",
|
| 131 |
+
"TiRex",
|
| 132 |
+
"TimesFM-2.5"
|
| 133 |
+
}
|
| 134 |
+
df = df[df["model"].isin(ALLOWED_MODELS)]
|
| 135 |
+
|
| 136 |
parts = df["dataset"].astype(str).str.split("/", expand=True)
|
| 137 |
if parts.shape[1] < 3:
|
| 138 |
for idx in range(parts.shape[1], 3):
|
|
|
|
| 638 |
|
| 639 |
def get_dataset_last_eval_time(ds_base: str, root_dir: str = "results") -> datetime | None:
|
| 640 |
latest_dt: datetime | None = None
|
| 641 |
+
ALLOWED_SLUGS = {"chronos_2", "moirai_1_1_large", "timer_s1", "timesfm_2_5", "tirex", "toto_2_0_1b"}
|
| 642 |
# Scan model directories
|
| 643 |
for model_dir in Path(root_dir).iterdir():
|
| 644 |
+
if not model_dir.is_dir() or model_dir.name not in ALLOWED_SLUGS:
|
| 645 |
continue
|
| 646 |
forecasts_dir = model_dir / "forecasts"
|
| 647 |
if not forecasts_dir.is_dir():
|
|
|
|
| 720 |
# Fallback to current snapshots count if history is empty or fails
|
| 721 |
if not timestamp_counts:
|
| 722 |
seen_datasets: set[str] = set()
|
| 723 |
+
ALLOWED_SLUGS = {"chronos_2", "moirai_1_1_large", "timer_s1", "timesfm_2_5", "tirex", "toto_2_0_1b"}
|
| 724 |
for model_dir in sorted(Path(root_dir).iterdir()):
|
| 725 |
+
if not model_dir.is_dir() or model_dir.name not in ALLOWED_SLUGS:
|
| 726 |
+
continue
|
| 727 |
forecasts_dir = model_dir / "forecasts"
|
| 728 |
if not forecasts_dir.is_dir():
|
| 729 |
continue
|