mirror of
https://github.com/amazon-science/chronos-forecasting
synced 2026-05-24 10:08:33 +00:00
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:
parent
f0e1ef5b8f
commit
564218776a
1 changed files with 2 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue