#                🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
#           This file was automatically generated from src/transformers/models/timesfm2_5/modular_timesfm2_5.py.
#               Do NOT edit this file manually as any edits will be overwritten by the generation of
#             the file from the modular. If any change should be done, please apply the change to the
#                          modular_timesfm2_5.py file directly. One of our CI enforces this.
#                🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# Copyright 2026 the HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from huggingface_hub.dataclasses import strict

from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import RopeParameters
from ...utils import auto_docstring


@auto_docstring(checkpoint="google/timesfm-2.5-200m-transformers")
@strict
class TimesFm2_5Config(PreTrainedConfig):
    r"""
    patch_length (`int`, *optional*, defaults to 32):
        The length of one patch in the input sequence.
    context_length (`int`, *optional*, defaults to 16384):
        The length of the input context.
    horizon_length (`int`, *optional*, defaults to 128):
        The length of the prediction horizon.
    quantiles (`list[float]`, *optional*, defaults to `[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]`):
        The quantiles to predict.
    output_quantile_len (`int`, *optional*, defaults to 1024):
        Length of the quantile output projection dimension.
    decode_index (`int`, *optional*, defaults to 5):
        Index into the quantile dimension used to extract the point (median) forecast.
    use_bias (`bool`, *optional*, defaults to `False`):
        Whether to use bias in MLP and transformer linear layers.
    use_continuous_quantile_head (`bool`, *optional*, defaults to `True`):
        Whether to use the continuous quantile head for non-median quantile predictions.
    force_flip_invariance (`bool`, *optional*, defaults to `True`):
        Whether to apply flip-invariance averaging during forecasting.
    infer_is_positive (`bool`, *optional*, defaults to `True`):
        Whether to clamp forecasts to non-negative values when the input minimum is non-negative.

    Example:

    ```python
    >>> from transformers import TimesFm2_5Config, TimesFm2_5ModelForPrediction

    >>> configuration = TimesFm2_5Config()
    >>> model = TimesFm2_5ModelForPrediction(configuration)
    >>> configuration = model.config
    ```
    """

    model_type = "timesfm2_5"
    keys_to_ignore_at_inference = []
    is_encoder_decoder = False

    patch_length: int = 32

    context_length: int = 16384
    horizon_length: int = 128
    num_hidden_layers: int = 20
    hidden_size: int = 1280
    intermediate_size: int = 1280
    head_dim: int = 80
    num_attention_heads: int = 16
    rms_norm_eps: float = 1e-6
    quantiles: list[float] | tuple[float, ...] = (0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9)
    attention_dropout: float | int = 0.0
    initializer_range: float = 0.02
    num_key_value_heads: int = 16
    attention_bias: bool = False
    output_quantile_len: int = 1024
    decode_index: int = 5
    use_bias: bool = False
    activation: str = "swish"
    use_continuous_quantile_head: bool = True
    force_flip_invariance: bool = True
    infer_is_positive: bool = True
    max_position_embeddings: int = 16384
    rope_parameters: RopeParameters | dict | None = None


__all__ = ["TimesFm2_5Config"]
