google-research / timesfm

TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.
https://research.google/blog/a-decoder-only-foundation-model-for-time-series-forecasting/
Apache License 2.0
3.02k stars 228 forks source link

Fix importing patch_decoder #32

Closed zgeor closed 1 month ago

zgeor commented 1 month ago

After the latest package fix the patched_decoder cannot be imported. The error when executing the code is


File ~/dev/ml-workspace/timesfm/src/timesfm.py:38
        /dev/ml-workspace/timesfm/src/timesfm.py:36) from praxis.layers import normalizations
        /dev/ml-workspace/timesfm/src/timesfm.py:37) from praxis.layers import transformers
---> /dev/ml-workspace/timesfm/src/timesfm.py:38) from . import patched_decoder
        /dev/ml-workspace/timesfm/src/timesfm.py:39) from utilsforecast.processing import make_future_dataframe
        /dev/ml-workspace/timesfm/src/timesfm.py:41) instantiate = base_hyperparams.instantiate

ImportError: attempted relative import with no known parent package```

This small change will fix the import. I've tested this locally. 
siriuz42 commented 1 month ago

Thanks for the fix.