
    ^j1                     z    d Z ddlmZ ddlmZ ddlmZmZ ddlm	Z	 dgZ
 e	d	      e G d
 de                    Zy)z#RADIO vision encoder configuration.    )strict   )PreTrainedConfig)OPENAI_CLIP_MEANOPENAI_CLIP_STD)auto_docstringRadioConfigznvidia/C-RADIOv4-H)
checkpointc                       e Zd ZU dZdZdZeed<   dZeed<   dZ	eed<   d	Z
eed
<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed <   d!Zeed"<   d#Zee   d#z  ed$<    ee      Z ee   eeeef   z  ed%<    ee!      Z"ee   eeeef   z  ed&<   d'Z#eed(<    fd)Z$e%d*efd+       Z& xZ'S ),r	   a  
    mlp_ratio (`float`, *optional*, defaults to 4.0):
        Ratio of the hidden size of the MLP relative to `hidden_size`.
    use_swiglu_ffn (`bool`, *optional*, defaults to `False`):
        Whether to use a SwiGLU feed-forward network in the encoder layers instead of the standard MLP.
    layerscale_value (`float`, *optional*, defaults to 1.0):
        Initial value for the LayerScale parameters. C-RADIO has no LayerScale; the default of `1.0` makes the
        (inherited) LayerScale an identity operation.
    max_img_size (`int`, *optional*, defaults to 2048):
        Maximum supported image size (in pixels) used to size the position embedding table of the CPE patch generator.
    num_cls_tokens (`int`, *optional*, defaults to 3):
        Number of learned class (summary) tokens prepended to the patch sequence.
    num_registers (`int`, *optional*, defaults to 7):
        Number of learned register tokens prepended to the patch sequence.
    summary_idxs (`list[int]`, *optional*, defaults to `[0, 1]`):
        Indices of the class tokens to gather and flatten into the `summary` output embedding.
    norm_mean (`tuple[float, float, float]`, *optional*, defaults to `OPENAI_CLIP_MEAN`):
        Per-channel mean used by the input conditioner to normalize pixel values.
    norm_std (`tuple[float, float, float]`, *optional*, defaults to `OPENAI_CLIP_STD`):
        Per-channel standard deviation used by the input conditioner to normalize pixel values.
    radioi   hidden_size    num_hidden_layers   num_attention_headsg      @	mlp_ratiogelu
hidden_actgư>layer_norm_epsg        attention_probs_dropout_probhidden_dropout_probdrop_path_rateFuse_swiglu_ffnTqkv_biasg      ?layerscale_valuer   num_channels
patch_size   
image_sizei   max_img_sizenum_cls_tokens   num_registersNsummary_idxs	norm_meannorm_stdg{Gz?initializer_rangec                     | j                   	ddg| _         t        | j                        | _        t        | j                        | _        t	        |   di | y )Nr       )r$   listr%   r&   super__post_init__)selfkwargs	__class__s     x/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/radio/configuration_radio.pyr-   zRadioConfig.__post_init__P   sK    $!"ADdnn-T]]+''    returnc                 4    | j                   | j                  z   S )zJNumber of skipped prefix tokens (cls + registers) before spatial features.)r!   r#   )r.   s    r1   num_summary_tokenszRadioConfig.num_summary_tokensW   s     ""T%7%777r2   )(__name__
__module____qualname____doc__
model_typer   int__annotations__r   r   r   floatr   strr   r   r   r   r   boolr   r   r   r   r   r    r!   r#   r$   r+   tupler   r%   r   r&   r'   r-   propertyr5   __classcell__)r0   s   @r1   r	   r	      sO   , JKs!!IuJ NE *- %-!$$NE ND Hd!e!L#JJL#NCM3%)L$s)d"):?@P:QItE{U5%#677Q9>9OHd5kE%"566O#u#( 8C 8 8r2   N)r9   huggingface_hub.dataclassesr   configuration_utilsr   image_utilsr   r   utilsr   __all__r	   r*   r2   r1   <module>rH      sI    * . 3 < # / /0>8" >8  1>8r2   