TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.
Python
use repo_id to download checkpoints
Kashif Rasulafeb84f77ac8
diff --git a/src/timesfm.py b/src/timesfm.pyindex b795450..56456f5 100644--- a/src/timesfm.py+++ b/src/timesfm.py@@ -24,6 +24,7 @@ import jaximport jax.numpy as jnpimport numpy as npimport pandas as pd+from huggingface_hub import hf_hub_downloadfrom paxml import checkpointsfrom paxml import tasks_libfrom praxis import base_hyperparams@@ -222,7 +223,7 @@ class TimesFm:def load_from_checkpoint(self,- checkpoint_path: str,+ repo_id: str = "google/timesfm-1.0-200m",checkpoint_type: checkpoints.CheckpointType = checkpoints.CheckpointType.FLAX,step: int | None = None,) -> None:@@ -233,6 +234,9 @@ class TimesFm:checkpoint_type: type of PAX checkpointstep: step of the checkpoint to load. If `None`, load lastest checkpoint."""+ # Download the checkpoint from Hugging Face Hub+ checkpoint_path = hf_hub_download(repo_id)+# Initialize the model weights.self._logging("Constructing model weights.")start_time = time.time()