Conversation
|
Nice PR! @GeoffNN Leaving my two cents here as the original contributor of Would you consider relaxing t0 python bounds to 3.10+ so all users can access your model? Also, is there a reason why past covariates cannot be supported? I have not looked into the model architecture, but would implanting past covariates as part of the context help improve the forecast quality? If so, I would suggest appending past covariates to the context and dropping them from the output. PS. It would be nice if a technical report / blog post can be provided to help us and users understand the model better. |
|
Hi @daidahao ! The tech report & blog post are both incoming, we'll release this a bit later. |
|
Thanks a lot for this PR @GeoffNN 🚀 Before giving a full review, there are two points:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3142 +/- ##
=======================================
Coverage 97.05% 97.06%
=======================================
Files 169 170 +1
Lines 18903 18978 +75
=======================================
+ Hits 18347 18421 +74
- Misses 556 557 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi both!
Since the model is Apache 2.0, there's no restriction on our side for this! |
|
Thanks a lot for the updates @GeoffNN, that sounds great 🚀 Regarding fine-tuning:
Let me know if it's clear or whether we can support in any way. |
|
@GeoffNN another question regarding adding tfc-t0 as a dependency to Darts: I quickly checked out your dependency requirements and noticed that all have an upper version cap here. Is there a specific reason you limit the upper versions? That would mean that at some point, tfc-t0 would block Darts users from installing newer dependency versions. Would it be possible to relax (remove) these caps? |
|
Hello! Sorry for the delay here, we've been traveling - and want to think about the API surface we expose, especially for the with-gradients side. Re: versions - I believe we gate against untested (future) versions, to avoid breaking the package silently if the dependencies change their API on a major version. Let me double check. |
|
Thanks for the updates @GeoffNN 🚀 In the open-source world the continuous dependency integration (e.g. checking against newest versions and then fixing the package continuously if there are some breaking changes in dependencies) is a pro-active way to keep the package up-to-date. So, I would always recommend to go that way (except maybe where you're developing apps or similar where you want to ensure everyone user gets the exact same fixed environment (via dependency lockfiles for example). Let me know what you think |
Resolve CHANGELOG.md conflict by dropping the unit8co#1915, unit8co#3147 and unit8co#1917 unreleased entries that master has since shipped in 0.46.0, keeping the still-unreleased T0Model entry (unit8co#3142). Bump the tfc-t0 pin to >=0.2.2, whose release drops the dependency upper bounds (and the requires-python ceiling) raised in review. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
134a5a1 to
667e480
Compare
- Add classes to use t0-alpha for inference and fine-tuning. - Add t0-alpha fine-tuning example to the dedicated notebook. - Add tests for T0Model classes - Add tfc-t0 v0.4.0 to the optional dependencies Co-authored-by: Huikan Xiang <huikan-tfc@users.noreply.github.com> Co-authored-by: Geoffrey Négiar <GeoffNN@users.noreply.github.com>
1d84b09 to
3d704c6
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
keep only the smaller model
|
Hi @dennisbader and @daidahao,
It should be done now. Thanks for the suggestion. The model indeed supports past (passed along the context) and future covariates.
We now rely on the
One important note on the model, it is currently gated on Hugging Face. Still, anyone can have access to it, and again it has been released under Apache 2 license. We added a note to the notebook, but I don't know whether it may bother your CI.
The tech report is coming very shortly. I'll drop a comment here whenever it's released. |
Here it is. |
|
Thanks for the updates and all the changes both on this PR and the I've tested it on my side and also made the PR work with our torch module I/O refactor #3204. Would it be possible to grant me write permission to your Darts fork? Then I could apply the changes there directly. |
|
Hi @dennisbader , thank you! I just granted you access to our Darts fork. Much appreciated! 🙌 |
|
Thanks for the invite @jfainberg :) For some reason I'm still not able to push to the branch due to missing permissions. Could you maybe check again for the correct permissions? |
|
@jfainberg sorry, nevermind, now it works :) I was using the wrong token 🙈. |
|
no problem @dennisbader ! :) |
|
Hi all and thanks a lot for the great PR @GeoffNN, @LTMeyer, @huikan-tfc and @jfainberg 🚀 I've applied some minor changes to make the model ready for merging:
I wanted to double check with you to make sure everything is implemented correctly for t0-beta in our Darts model wrapper. Below you can find an example comparing t0-alpha against t0-beta using our Would you mind reviewing once the current Darts implementation so we can get it ready for merging? Thanks a lot! Code examplefrom darts.datasets import ElectricityConsumptionZurichDataset
from darts.models import T0Model
# use past month to forecast one week (in quarterly hours)
context_length = 30 * 24 * 4
horizon = 7 * 24 * 4
series = ElectricityConsumptionZurichDataset().load().astype("f")["Value_NE5"]
train = series[:-horizon]
fig = series[-2*horizon:].plotly(label="actual")
for model_card, color in zip(
["theforecastingcompany/t0-alpha", "theforecastingcompany/t0-beta"],
["red", "green"],
):
model = T0Model(
input_chunk_length=30 * 24 * 4,
output_chunk_length=horizon,
hub_model_name=model_card,
)
forecast = model.fit(train).predict(n=horizon, series=train)
name = model_card.split("/")[-1]
fig = forecast.plotly(label=f"forecast: {name}", fig=fig, color=color)
fig.show()
|
|
Thank you @dennisbader for the update and providing this new example. t0-alpha and t0-beta have some differences internally, but this should be already captured by the model card. Let me dig a bit more! |
|
Hi @dennisbader, thank you again for raising the issue. We were able to reproduce it locally. It seems, so far, t0-beta is indeed not performing great on this time series and this context size. Still, we believe we can move on with this PR, if it's good for you, while we will work on fixing t0-beta on this example. |


Hi folks! Great work on darts! 🙏
We just released our first open-source model: t0-alpha. Adding it to your library so people can easily use it, benchmark it etc.
Checklist before merging this PR:
Summary
Adds
T0Model, a Darts wrapper around The Forecasting Company's open-weights T0 foundation model (~100M-parameter patch transformer for zero-shot forecasting). It follows the existing foundation-model pattern, closest toTiRexModel(delegates to an optional pip package) while also supporting future covariates likeChronos2Model.FoundationModel; zero-shot inference for univariate, multivariate, and multiple series.tfc-t0package (from t0 import T0Forecaster), declared in theoptionaldependency group (not pulled bydarts[torch]).supports_future_covariates=True):forward()reassembles Darts'(x_past, x_future)into T0's[B, F, context + horizon]covariate layout, NaN-filling theoutput_chunk_shiftgap (T0 treats NaN as missing). Past covariates are not supported.QuantileRegression. Any quantiles in(0, 1)are accepted — T0 interpolates levels it was not trained on (it was trained on[0.1, 0.25, 0.5, 0.75, 0.9]).predict()runs undertorch.inference_mode()).Registered in the models lazy-import table,
conftestavailability flag (T0_AVAILABLE), README / INSTALL / docs model tables,pyproject.tomloptionalgroup, andCHANGELOG.md.Other Information
Tests in
darts/tests/models/forecasting/test_t0.pymockT0Forecaster.from_pretrainedso CI never downloads weights (gated behindT0_AVAILABLE, matching the TiRex test pattern). Covers creation/validation, deterministic + probabilistic, multivariate, future covariates, and multiple series.Verified locally against the real
theforecastingcompany/t0-alphaweights — univariate deterministic, probabilistic with interpolated quantiles (0.05/0.95), future-covariate, and multivariate forecasts all produce finite outputs of the expected shape.🤖 Generated with Claude Code