Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ dependencies = [
"statsforecast>=2.0.2",
"tabpfn-time-series==1.0.3 ; python_full_version < '3.13'",
"tensorboard>=2.20.0",
"tfc-t0>=0.2.0 ; python_full_version >= '3.11' and python_full_version < '3.14'",
"tfc-t0>=0.2.3 ; python_full_version >= '3.11' and python_full_version < '3.14'",
"timecopilot-chronos-forecasting>=0.2.2",
"timecopilot-granite-tsfm>=0.2.1 ; python_full_version >= '3.11' and python_full_version < '3.14'",
"timecopilot-timesfm>=0.3.0",
Expand Down
12 changes: 11 additions & 1 deletion timecopilot/models/foundation/t0.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import sys
from contextlib import contextmanager

Expand All @@ -7,6 +8,8 @@
import numpy as np
import pandas as pd
import torch
from huggingface_hub import hf_hub_download
from huggingface_hub.constants import CONFIG_NAME
from t0 import T0Forecaster
from tqdm import tqdm

Expand Down Expand Up @@ -87,7 +90,14 @@ def __init__(

@contextmanager
def _get_model(self) -> T0Forecaster:
model = T0Forecaster.from_pretrained(self.repo_id).to(self.device).eval()
# huggingface_hub may not inject config.json into model kwargs when the
# checkpoint repo is gated; pass the config explicitly.
config_path = hf_hub_download(self.repo_id, CONFIG_NAME)
with open(config_path, encoding="utf-8") as f:
config = json.load(f)
model = (
T0Forecaster.from_pretrained(self.repo_id, **config).to(self.device).eval()
)
try:
yield model
finally:
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading