#                🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
#           This file was automatically generated from src/transformers/models/pp_ocrv6_small_rec/modular_pp_ocrv6_small_rec.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_pp_ocrv6_small_rec.py file directly. One of our CI enforces this.
#                🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# Copyright 2026 The PaddlePaddle Team and The HuggingFace Inc. 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 ...backbone_utils import consolidate_backbone_kwargs_to_config
from ...configuration_utils import PreTrainedConfig
from ...utils import auto_docstring
from ..auto import AutoConfig


@auto_docstring(checkpoint="PaddlePaddle/PP-OCRv6_small_rec_safetensors")
@strict
class PPOCRV6SmallRecConfig(PreTrainedConfig):
    r"""
    head_out_channels (`int`, *optional*, defaults to 18714):
        The number of output channels from the PPOCRV6SmallRecHead, responsible for final classification.
    """

    model_type = "pp_ocrv6_small_rec"
    sub_configs = {"backbone_config": AutoConfig}

    hidden_act: str = "silu"
    backbone_config: dict | PreTrainedConfig | None = None
    hidden_size: int = 120
    mlp_ratio: float = 2.0
    depth: int = 2

    head_out_channels: int = 18714
    conv_kernel_size: list | None = None
    qkv_bias: bool = True
    num_attention_heads: int = 8
    attention_dropout: float | int = 0.0
    layer_norm_eps: float = 1e-6

    def __post_init__(self, **kwargs):
        if self.conv_kernel_size is None:
            self.conv_kernel_size = [1, 7]
        self.backbone_config, kwargs = consolidate_backbone_kwargs_to_config(
            backbone_config=self.backbone_config,
            default_config_type="pp_lcnet_v4",
            **kwargs,
        )
        super().__post_init__(**kwargs)


__all__ = ["PPOCRV6SmallRecConfig"]
