Skip to content

Deprecation warning: "Passing a tuple of past_key_values is deprecated" #290

@corneliusroemer

Description

@corneliusroemer

Bug report checklist

  • I provided code that demonstrates a minimal reproducible example.
  • I confirmed bug exists on the latest mainline of Chronos via source install.

Describe the bug
When running the example code from readme using amazon/chronos-bolt-base I get:

Passing a tuple of `past_key_values` is deprecated and will be removed in Transformers v4.48.0. You should pass an instance of `EncoderDecoderCache` instead, e.g. `past_key_values=EncoderDecoderCache.from_legacy_cache(past_key_values)`.

Expected behavior
No deprecation warning

To reproduce

pipeline: BaseChronosPipeline = BaseChronosPipeline.from_pretrained(
    "amazon/chronos-bolt-base",  # use "amazon/chronos-bolt-small" for the corresponding Chronos-Bolt model
    device_map="cpu",  # use "cpu" for CPU inference
    torch_dtype=torch.bfloat16,
)

quantiles, mean = pipeline.predict_quantiles(
    context=torch.tensor(df["#Passengers"][:-12]),
    prediction_length=12,
    quantile_levels=[0.1, 0.5, 0.9],
)

Environment description
Operating system: macOS
Python version: 3.12
CUDA version: NA
PyTorch version:
HuggingFace transformers version:
HuggingFace accelerate version:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions