feat: add tirex-2 model - #366
Merged
Merged
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds TiRex-2 support to the existing TiRex forecaster, updates project dependencies/tests accordingly, and restructures the documentation Examples section while introducing a new v0.0.30 changelog entry.
Changes:
- Add TiRex-2 backend dispatching in
TiRex(model loading + forecasting path). - Add TiRex-2 tests and include TiRex-2 in the shared model test matrix.
- Restructure docs navigation/examples and add a new changelog page for v0.0.30.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| timecopilot/models/foundation/tirex.py | Adds TiRex-2 detection + v1/v2 model loading and forecasting dispatch. |
| tests/models/foundation/test_tirex.py | Adds basic dispatch and TiRex-2 forecasting tests. |
| tests/models/conftest.py | Adds TiRex-2 to the shared model list for model-level tests. |
| pyproject.toml | Adds TiRex-2-related dependencies and bumps timecopilot-uni2ts. |
| mkdocs.yml | Restructures Examples nav and adds v0.0.30 changelog entry. |
| docs/model-hub.md | Updates model hub to reference family example notebooks and TiRex/TiRex-2 naming. |
| docs/getting-started/quickstart.md | Updates Quickstart to point readers to the new Examples index. |
| docs/examples/index.md | Adds a new Examples landing page organizing notebooks by category. |
| docs/contributing.md | Updates contributor guidance to match the new Examples nav structure. |
| docs/changelogs/v0.0.30.md | Adds v0.0.30 changelog entry describing TiRex-2 support and related changes. |
| docs/changelogs/index.md | Adds v0.0.30 link to the changelog index. |
| .github/workflows/ci.yaml | Updates lint step to run pre-commit via uv run. |
Suppressed comments (1)
timecopilot/models/foundation/tirex.py:109
_get_model_v1setsos.environ["TIREX_NO_CUDA"] = "1"when running on CPU, but never restores the previous value. Because this is a process-wide environment variable, it can leak into later model loads (including subsequent TiRex calls in the same process) and change behavior unexpectedly. Capture the previous value and restore it in thefinallyblock.
device = "cuda" if torch.cuda.is_available() else "cpu"
if device == "cpu":
# see https://github.com/NX-AI/tirex/tree/main?tab=readme-ov-file#cuda-kernels
os.environ["TIREX_NO_CUDA"] = "1"
model = load_model(self.repo_id, device=device)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this pr adds tirex-2, including its support trough the
Tirexclass, tests, and an example. in prepartion for a new release, it also adds a changelog and a new structure for the examples section.