6ieyd9hx juliendenize commited on
Commit
302aeeb
·
0 Parent(s):

Duplicate from mistralai/Timestral-209M

Browse files

Co-authored-by: Julien Denize <juliendenize@users.noreply.huggingface.co>

Files changed (6) hide show
  1. .gitattributes +35 -0
  2. LICENSE +10 -0
  3. README.md +164 -0
  4. config.json +71 -0
  5. model.safetensors +3 -0
  6. timestral-hourglass.png +0 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ Modified MIT License
2
+
3
+ Attribution notice: 2026 - Mistral AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of the weights of this model and associated documentation files (the “Model”), to deal in the Model without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Model, and to permit persons to whom the Model is furnished to do so, subject to the following conditions:
6
+
7
+ 1. The above attribution notice and this permission notice shall be included in all copies or substantial portions of the Model.
8
+ 2. You are not authorized to exercise any rights under this license if the global consolidated monthly revenue of your company (or that of your employer) exceeds $20 million (or its equivalent in another currency) for the preceding month. This restriction in (b) applies to the Model and any derivatives, modifications, or combined works based on it, whether provided by Mistral AI or by a third party. You may contact Mistral AI (sales@mistral.ai) to request a commercial license, which Mistral AI may grant you at its sole discretion, or choose to use the Model on Mistral AI's hosted services available at https://mistral.ai/.
9
+
10
+ THE MODEL IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL MISTRAL AI BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MODEL OR THE USE OR OTHER DEALINGS IN THE MODEL.
README.md ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: time-series-forecasting
3
+ library_name: timestral
4
+ tags:
5
+ - time-series
6
+ - forecasting
7
+ - foundation-model
8
+ model-index:
9
+ - name: Timestral-209M
10
+ results:
11
+ - task:
12
+ type: time-series-forecasting
13
+ name: Time Series Forecasting
14
+ dataset:
15
+ name: GIFT-Eval
16
+ type: Salesforce/GiftEval
17
+ metrics:
18
+ - name: MASE
19
+ type: mase
20
+ value: 0.658
21
+ - name: CRPS
22
+ type: crps
23
+ value: 0.446
24
+ source:
25
+ name: GIFT-Eval leaderboard
26
+ url: https://huggingface.co/spaces/Salesforce/GIFT-Eval
27
+ - task:
28
+ type: time-series-forecasting
29
+ name: Time Series Forecasting
30
+ dataset:
31
+ name: TIME
32
+ type: Real-TSF/TIME
33
+ metrics:
34
+ - name: MASE
35
+ type: mase
36
+ value: 0.626
37
+ - name: CRPS
38
+ type: crps
39
+ value: 0.522
40
+ source:
41
+ name: TIME leaderboard
42
+ url: https://huggingface.co/spaces/Real-TSF/TIME-leaderboard
43
+ - task:
44
+ type: time-series-forecasting
45
+ name: Time Series Forecasting
46
+ dataset:
47
+ name: fev-bench
48
+ type: autogluon/fev-bench
49
+ metrics:
50
+ - name: SQL skill score
51
+ type: skill-score
52
+ value: 50.39
53
+ - name: MASE skill score
54
+ type: skill-score
55
+ value: 39.49
56
+ source:
57
+ name: fev-bench leaderboard
58
+ url: https://huggingface.co/spaces/autogluon/fev-bench
59
+ license: other
60
+ ---
61
+
62
+
63
+ <h1><img src="timestral-hourglass.png" alt="" style="display:inline; height:1em; width:auto; margin:0 0.3em 0 0; vertical-align:-0.1em;"> Timestral-209M</h1>
64
+
65
+
66
+ Timestral is a **family of time series foundation models** for zero-shot forecasting, available in [**5M**](https://huggingface.co/mistralai/Timestral-5M), [**28M**](https://huggingface.co/mistralai/Timestral-28M), [**123M**](https://huggingface.co/mistralai/Timestral-123M), and [**209M**](https://huggingface.co/mistralai/Timestral-209M) parameter versions.
67
+ This repository contains the 209M checkpoint.
68
+
69
+ Timestral supports univariate and multivariate forecasting, past-only and known-future covariates, and probabilistic predictions across 21 quantiles. It accepts up to 32,768 historical time steps and forecasts up to 1,024 steps in a single forward pass.
70
+
71
+ We’re releasing the source code in our [GitHub repository](https://github.com/mistralai/timestral/) to make it easy to run Timestral and reproduce our benchmark results.
72
+
73
+ ## Model Details
74
+
75
+ - **Size:** 209M parameters.
76
+ - **Architecture:** patch-based transformer with time attention and variate attention, 24 layers, embedding dimension 768.
77
+ - **Patching:** 32 time steps per patch. Each patch is embedded from its values together with their missing-value indicators.
78
+ - **Context length:** up to 32,768 time steps (1,024 patches).
79
+ - **Forecast horizon**: Up to 1,024 time steps (32 patches) in a single forward pass. Longer horizons are forecast block by block, with each block's median forecast appended to the context.
80
+ - **Outputs:** 21 quantiles (0.01, 0.05, 0.1, 0.15, …, 0.85, 0.9, 0.95, 0.99).
81
+ - **Inputs:** univariate or multivariate target variates, plus past-only and known-future covariates, numeric or categorical (categorical covariates are target-encoded). Missing values are marked as NaN.
82
+ - **Inference:** PyTorch on CPU or GPU.
83
+
84
+
85
+ ## Benchmarks
86
+ Timestral-209M achieves **state-of-the-art zero-shot accuracy** across three major forecasting benchmarks: [GIFT-Eval](https://huggingface.co/spaces/Salesforce/GIFT-Eval), [TIME](https://huggingface.co/spaces/Real-TSF/TIME-leaderboard), and [fev-bench](https://huggingface.co/spaces/autogluon/fev-bench).
87
+
88
+ ### Timestral-209M compared with other models
89
+ | Benchmark | Metric | [Timestral-209M](https://huggingface.co/mistralai/Timestral-209M) | t0-gamma | TimesFM-3 | Toto-2.0-2.5B | Chronos-2 |
90
+ |---|---|---|---|---|---|---|
91
+ | GIFT-Eval | MASE ↓ | **0.658** | 0.661 | 0.667 | 0.696 | 0.698 |
92
+ | | CRPS ↓ | **0.446** | 0.452 | 0.456 | 0.476 | 0.485 |
93
+ | TIME | MASE ↓ | **0.626** | 0.637 | 0.640 | 0.642 | 0.662 |
94
+ | | CRPS ↓ | **0.522** | 0.534 | 0.536 | 0.539 | 0.556 |
95
+ | fev-bench | SQL skill score ↑ | **50.39** | 49.42 | 48.99 | 44.42 | 47.28 |
96
+ | | MASE skill score ↑ | **39.49** | 37.99 | 37.82 | 32.54 | 35.50 |
97
+
98
+ ### Results across the Timestral family
99
+ | Benchmark | Metric | [Timestral-5M](https://huggingface.co/mistralai/Timestral-5M) | [Timestral-28M](https://huggingface.co/mistralai/Timestral-28M) | [Timestral-123M](https://huggingface.co/mistralai/Timestral-123M) | [Timestral-209M](https://huggingface.co/mistralai/Timestral-209M) |
100
+ |---|---|---|---|---|---|
101
+ | GIFT-Eval | MASE ↓ | 0.705 | 0.678 | 0.659 | **0.658** |
102
+ | | CRPS ↓ | 0.479 | 0.461 | 0.448 | **0.446** |
103
+ | TIME | MASE ↓ | 0.652 | 0.638 | 0.628 | **0.626** |
104
+ | | CRPS ↓ | 0.545 | 0.534 | 0.525 | **0.522** |
105
+ | fev-bench | SQL skill score ↑ | 46.19 | 48.42 | 50.18 | **50.39** |
106
+ | | MASE skill score ↑ | 34.54 | 37.27 | 39.19 | **39.49** |
107
+
108
+ The Pareto-front plot below illustrates the trade-off between model size and forecasting performance across the Timestral family.
109
+
110
+ ![Pareto front of model size versus forecasting performance for the Timestral models](https://cdn-uploads.huggingface.co/production/uploads/6a883eae29d17c41f6dbdfd4/FoDdgcwd64Zwg4L29FShg.png)
111
+
112
+ ## Usage
113
+
114
+ ### Install
115
+
116
+ Set up your environment:
117
+
118
+ ```bash
119
+ pip install git+https://github.com/mistralai/timestral.git # Python >= 3.10, torch >= 2.4
120
+ ```
121
+
122
+ Or from a clone with [uv](https://docs.astral.sh/uv/), using the versions pinned in `uv.lock`:
123
+
124
+ ```bash
125
+ git clone https://github.com/mistralai/timestral.git && cd timestral
126
+ uv sync --frozen
127
+ source .venv/bin/activate
128
+ ```
129
+
130
+ ### Run the model
131
+
132
+ Here is a simple example using synthetic data.
133
+
134
+ ```python
135
+ import numpy as np
136
+ import torch
137
+ from timestral import TimestralForecaster
138
+
139
+ model = TimestralForecaster.from_pretrained(
140
+ "mistralai/Timestral-209M",
141
+ device="cuda" if torch.cuda.is_available() else "cpu"
142
+ )
143
+
144
+ # Synthetic example: one series with 1,000 historical observations.
145
+ context = np.random.default_rng(42).standard_normal(1000).cumsum()
146
+ forecast = model.forecast(context, prediction_length=96)
147
+
148
+ median = forecast.median
149
+ lower, upper = forecast.quantile(0.1), forecast.quantile(0.9)
150
+ ```
151
+
152
+ Check out our [GitHub repository](https://github.com/mistralai/timestral/) for more details!
153
+
154
+ ## Additional Resources
155
+ - [Blog post](https://mistral.ai/news/timestral/)
156
+ - [GitHub repository](https://github.com/mistralai/timestral/)
157
+ - Tech report: coming soon!
158
+
159
+
160
+ ## License
161
+
162
+ Models have been released under a Modified MIT license: See [here](https://huggingface.co/mistralai/Timestral-209M/blob/main/LICENSE).
163
+
164
+ *You must not use this model in a manner that infringes, misappropriates, or otherwise violates any third party’s rights, including intellectual property rights*
config.json ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "patch_size": 32,
3
+ "d_model": 768,
4
+ "num_heads": 12,
5
+ "mlp_hidden_dim": 2048,
6
+ "block_schedule": [
7
+ "time",
8
+ "time",
9
+ "time",
10
+ "time_variate",
11
+ "time",
12
+ "time",
13
+ "time",
14
+ "time_variate",
15
+ "time",
16
+ "time",
17
+ "time",
18
+ "time_variate",
19
+ "time",
20
+ "time",
21
+ "time",
22
+ "time_variate",
23
+ "time",
24
+ "time",
25
+ "time",
26
+ "time_variate",
27
+ "time",
28
+ "time",
29
+ "time",
30
+ "time_variate"
31
+ ],
32
+ "quantile_knots": [
33
+ 0.01,
34
+ 0.05,
35
+ 0.1,
36
+ 0.15,
37
+ 0.2,
38
+ 0.25,
39
+ 0.3,
40
+ 0.35,
41
+ 0.4,
42
+ 0.45,
43
+ 0.5,
44
+ 0.55,
45
+ 0.6,
46
+ 0.65,
47
+ 0.7,
48
+ 0.75,
49
+ 0.8,
50
+ 0.85,
51
+ 0.9,
52
+ 0.95,
53
+ 0.99
54
+ ],
55
+ "block_size": 32,
56
+ "context_length": 32768,
57
+ "rope_theta": 10000.0,
58
+ "rope_partial_factor": 0.5,
59
+ "norm_eps": 1e-06,
60
+ "attn_bias": false,
61
+ "mlp_bias": false,
62
+ "time_attn_gate": "sdpa_sigmoid",
63
+ "variate_attn_gate": "sdpa_sigmoid",
64
+ "minimum_scale": 1e-06,
65
+ "use_asinh": true,
66
+ "stabilize_with_global": false,
67
+ "covariate_enabled": true,
68
+ "split_context_horizon_attn": true,
69
+ "attend_missing_patches": true,
70
+ "quantile_width_factor": 3.0
71
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1456effb9927e3daa8c7234f10497e3424233869245a9c72b8ecebaf7ad2b7fa
3
+ size 837271648
timestral-hourglass.png ADDED