#                🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
#           This file was automatically generated from src/transformers/models/hyperclovax_vision_v2/modular_hyperclovax_vision_v2.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_hyperclovax_vision_v2.py file directly. One of our CI enforces this.
#                🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# Copyright 2026 NAVER Corp. and 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, SubConfigSpec
from ...utils import auto_docstring
from ..auto import AutoConfig


@auto_docstring(checkpoint="naver-hyperclovax/HyperCLOVAX-SEED-Think-32B")
@strict
class HyperCLOVAXVisionV2Config(PreTrainedConfig):
    r"""
    ```python
    >>> from transformers import HyperCLOVAXVisionV2Config, HyperCLOVAXVisionV2ForConditionalGeneration

    >>> # Initializing a HyperCLOVAX Vision V2 configuration with defaults
    >>> configuration = HyperCLOVAXVisionV2Config()

    >>> # Initializing a model from the configuration
    >>> model = HyperCLOVAXVisionV2ForConditionalGeneration(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    """

    model_type = "hyperclovax_vision_v2"
    sub_configs_defaults = {
        "vision_config": SubConfigSpec(config_class=AutoConfig, model_type="qwen2_5_vl_vision"),
        "text_config": SubConfigSpec(config_class=AutoConfig, model_type="hyperclovax"),
    }
    keys_to_ignore_at_inference = ["past_key_values"]

    text_config: dict | PreTrainedConfig | None = None
    vision_config: dict | PreTrainedConfig | None = None
    image_token_id: int = 128060
    video_token_id: int = 128061
    tie_word_embeddings: bool = True

    def __post_init__(self, **kwargs):
        # The Hub config uses the full Qwen2.5-VL type for the vision transformer.
        if isinstance(self.vision_config, dict) and self.vision_config.get("model_type") == "qwen2_5_vl":
            self.vision_config["model_type"] = "qwen2_5_vl_vision"

        # This is necessary to properly find the weight conversion mapping.
        if kwargs.get("model_type") == "vlm":
            kwargs["model_type"] = "hyperclovax_vision_v2"

        super().__post_init__(**kwargs)


__all__ = ["HyperCLOVAXVisionV2Config"]
