mirror of
https://github.com/amazon-science/chronos-forecasting
synced 2026-05-24 10:08:33 +00:00
Chronos-2: Update context_length if fine-tuned with longer than default (#419)
*Issue #, if available:* *Description of changes:* 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
3cb8f8831a
commit
f0e1ef5b8f
1 changed files with 2 additions and 1 deletions
|
|
@ -331,7 +331,8 @@ class Chronos2Pipeline(BaseChronosPipeline):
|
|||
|
||||
trainer.train()
|
||||
|
||||
# update max_output_patches, if the model was fine-tuned with longer prediction_length
|
||||
# update context_length and max_output_patches, if the model was fine-tuned with larger values
|
||||
model.chronos_config.context_length = max(model.chronos_config.context_length, context_length)
|
||||
model.chronos_config.max_output_patches = max(
|
||||
model.chronos_config.max_output_patches, math.ceil(prediction_length / self.model_output_patch_size)
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue