You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(chronos): add a finetune extra with peft for LoRA finetuning #57
Chronos supports ChronosFinetuningConfig(finetune_mode="lora"), and LoRA checkpoints are reloaded through PEFT (Chronos2Pipeline.from_pretrained). But peft is not a dependency of foundationforecast: it is absent from pyproject.toml and uv.lock.
As a result:
pip install foundationforecast succeeds, but LoRA finetuning fails at runtime with an import error from the Chronos backend.
tests/models/test_chronos.py uses pytest.importorskip("peft"), so the LoRA path is silently skipped in CI and never exercised.
Can I take this? Part 2 is done since #65 (peft>=0.20.0,<1 is now in the dev group, pyproject.toml line 8), so what's left:
Add finetune = ["peft>=0.20.0,<1"] under [project.optional-dependencies] next to plot (~80-84). I'd use 0.20, not the 0.13 in the issue, because Chronos._load_model imports peft.auto.get_default_import_allowlist for LoRA adapters (foundationforecast/models/chronos.py ~341-353), and refactor(chronos): require peft>=0.20 and drop the allowlist fallback #65 pinned 0.20 for that.
Fail early with a clear message: when finetuning_config.finetune_mode == "lora" (passed to fit at ~328-331), or an adapter_config.json is found at load time, check for peft and raise "LoRA finetuning needs peft: pip install 'foundationforecast[finetune]'". Today that's an ImportError from deep in the backend.
Test: monkeypatch the import to fail and assert the message for both paths. test_chronos_lora_finetuning_save_and_reuse (tests/models/test_chronos.py:67) keeps covering the real path.
Docs: install cell in docs/examples/finetuning.ipynb -> foundationforecast[plot,finetune], and the finetuning section of the docs.
Activity
sharmis-tp commentedon Oct 30, 2026
Can I take this? Part 2 is done since #65 (peft>=0.20.0,<1 is now in the dev group, pyproject.toml line 8), so what's left:
finetune = ["peft>=0.20.0,<1"]under [project.optional-dependencies] next toplot(~80-84). I'd use 0.20, not the 0.13 in the issue, because Chronos._load_model imports peft.auto.get_default_import_allowlist for LoRA adapters (foundationforecast/models/chronos.py ~341-353), and refactor(chronos): require peft>=0.20 and drop the allowlist fallback #65 pinned 0.20 for that.Separate commits per type, as AGENTS.md asks.