Chronos-2: Ensure updated chronos_config is saved after fine-tuning (#420)

*Issue #, if available:*

*Description of changes:* Previously, only the returned pipeline had
correct configuration but it was not being saved to disk.


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
This commit is contained in:
Abdul Fatir 2025-12-03 17:32:14 +01:00 committed by GitHub
parent f0e1ef5b8f
commit 564218776a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -336,6 +336,8 @@ class Chronos2Pipeline(BaseChronosPipeline):
model.chronos_config.max_output_patches = max(
model.chronos_config.max_output_patches, math.ceil(prediction_length / self.model_output_patch_size)
)
# update chronos_config in model's config, so it is saved correctly
model.config.chronos_config = model.chronos_config.__dict__
# Create a new pipeline with the fine-tuned model
finetuned_pipeline = Chronos2Pipeline(model=model)