Views
No views yet
transformers as TimesFm2_5ModelForPrediction.1import torch
2from transformers import Timesfm2P5ModelForPrediction
3
4model = TimesFm2_5ModelForPrediction.from_pretrained("google/timesfm-2.5-200m-transformers")
5model = model.to(torch.float32).eval()
6
7past_values = [
8 torch.linspace(0, 1, 100),
9 torch.sin(torch.linspace(0, 20, 67)),
10]
11
12with torch.no_grad():
13 outputs = model(past_values=past_values, forecast_context_len=1024)
14
15print(outputs.mean_predictions.shape)
16print(outputs.full_predictions.shape)src/transformers/models/timesfm_2p5/convert_timesfm_2p5_original_to_hf.pygoogle/timesfm-2.5-200m-pytorch2026-02-201@inproceedings{das2024a,
2 title={A decoder-only foundation model for time-series forecasting},
3 author={Abhimanyu Das and Weihao Kong and Rajat Sen and Yichen Zhou},
4 booktitle={Forty-first International Conference on Machine Learning},
5 year={2024},
6 url={https://openreview.net/forum?id=jn2iTJas6h}
7}