§
    ‚ŠtjÊ  ã                   ó  — d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	  e	j
        e¦  «        Z ed¬¦  «        e G d	„ d
e¦  «        ¦   «         ¦   «         Z ed¬¦  «        e G d„ de¦  «        ¦   «         ¦   «         Zdd
gZdS )zchameleon model configurationé    )Ústricté   )ÚPreTrainedConfig)ÚRopeParameters)Úauto_docstringÚloggingzfacebook/chameleon-7b)Ú
checkpointc                   ó  — e Zd ZU dZ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         eedf         z  ed<   dZeed<   dZee         dz  ed<   dZeez  ed<   dZeed<   dZdS )ÚChameleonVQVAEConfiga¸  
    resolution (`int`, *optional*, defaults to 512):
        Resolution of the input images.
    base_channels (`int`, *optional*, defaults to 128):
        Base channel count.
    channel_multiplier (`list[int]`, *optional*, defaults to `[1, 1, 2, 2, 4]`):
        Channel multipliers for each resolution.
    num_res_blocks (`int`, *optional*, defaults to 2):
        Number of residual blocks.
    attn_resolutions (`list[int]`, *optional*):
        Resolutions to apply attention.
    dropout (`float`, *optional*, defaults to 0.0):
        Dropout rate.
    attn_type (`str`, *optional*, defaults to `"vanilla"`):
        Attention type used in VQ-GAN encoder. Can be "vanilla" or None
    Úchameleon_vqganÚ	vq_configé   Ú	embed_dimi    Únum_embeddingsFÚdouble_latentÚlatent_channelsi   Ú
resolutionr   Úin_channelsé€   Úbase_channels)é   r   é   r   é   .Úchannel_multiplierr   Únum_res_blocksNÚattn_resolutionsç        ÚdropoutÚvanillaÚ	attn_typeç{®Gáz”?)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚbase_config_keyr   ÚintÚ__annotations__r   r   Úboolr   r   r   r   r   ÚlistÚtupler   r   r   Úfloatr    ÚstrÚinitializer_range© ó    ús/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/chameleon/configuration_chameleon.pyr   r      s  € € € € € € ðð ð" #€JØ!€Oà€IˆsÐÐÑØ€N�CÐÐÑØ€M�4ÐÐÑØ€O�SÐÐÑØ€J�ÐÐÑØ€K�ÐÐÑØ€M�3ÐÐÑØ6EÐ˜˜Sœ	 E¨#¨s¨(¤OÑ3ÐEÐEÑEØ€N�CÐÐÑØ)-Ð�d˜3”i $Ñ&Ð-Ð-Ñ-Ø€GˆU�S‰[ÐÐÑØ€IˆsÐÐÑØÐÐÐr1   r   c                   óÞ  ‡ — e Zd ZU dZdZdeiZdg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	dz  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	dz  e
d<   dZe	dz  e
d<   dZe	ee	         z  dz  e
d<   dZee
d<   dZeez  dz  e
d <   dZ edz  e
d!<   d"Z!ee	z  dz  e
d#<   dZ"e	dz  e
d$<   dZ#edz  e
d%<   dZ$ee%z  dz  e
d<   dZ&edz  e
d&<   dZ'ee
d'<   ˆ fd(„Z(ˆ xZ)S ))ÚChameleonConfiga¥  
    model_parallel_size (`int`, *optional*, defaults to 1):
        Number of shards used when training the model. This will be used in qk layernorm because the original Chameleon inference
        doesn't do reduction in those layers and each rank has its own biases.
    swin_norm (`bool`, *optional*, defaults to `False`):
        Use Swin Transformer normalization.
    vocabulary_map (`dict`, *optional*):
        A dictionary containing the vocabulary map from the tokenizer. Used to obtain tokens from the image inputs.

    ```python
    >>> from transformers import ChameleonModel, ChameleonConfig

    >>> # Initializing a chameleon chameleon-7b style configuration
    >>> configuration = ChameleonConfig()

    >>> # Initializing a model from the chameleon-7b style configuration
    >>> model = ChameleonModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    Ú	chameleonr   Úpast_key_valuesi   Ú
vocab_sizei   Úhidden_sizei +  Úintermediate_sizeé    Únum_hidden_layersÚnum_attention_headsNÚnum_key_value_headsÚsiluÚ
hidden_actÚmax_position_embeddingsr!   r/   gñhãˆµøä>Úrms_norm_epsTÚ	use_cacheÚpad_token_idr   Úbos_token_idr   Úeos_token_idFÚtie_word_embeddingsÚrope_parametersÚattention_biasr   Úattention_dropoutÚmodel_parallel_sizeÚ	swin_normÚvocabulary_mapÚmlp_biasc                 óT  •— | j         €.t                               d¦  «         t          ¦   «         | _         n0t	          | j         t
          ¦  «        rt          di | j         ¤Ž| _         | j        �| j                             d¦  «        nd | _         t          ¦   «         j
        di |¤Ž d S )NzJvq_config is None. initializing the ChameleonVQConfig with default values.z<image>r0   )r   ÚloggerÚinfor   Ú
isinstanceÚdictrL   ÚgetÚimage_token_idÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €r2   rV   zChameleonConfig.__post_init__v   s£   ø€ ØŒ>Ð!Ý�KŠKÐdÑeÔeÐeÝ1Ñ3Ô3ˆDŒNˆNÝ˜œ­Ñ-Ô-ð 	DÝ1ÐCÐC°D´NÐCÐCˆDŒNàDHÔDWÐDc˜dÔ1×5Ò5°iÑ@Ô@Ð@ÐimˆÔà�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r1   )*r"   r#   r$   r%   r&   r   Úsub_configsÚkeys_to_ignore_at_inferencer7   r(   r)   r8   r9   r;   r<   r=   r?   r.   r@   r/   r-   rA   rB   r*   rC   rD   rE   r+   rF   rG   r   rR   rH   rI   rJ   rK   r   r   rL   rM   rV   Ú__classcell__)rY   s   @r2   r4   r4   @   s  ø€ € € € € € ðð ð. €JØÐ 4Ð5€KØ#4Ð"5Ðà€J�ÐÐÑØ€K�ÐÐÑØ"Ð�sÐ"Ð"Ñ"ØÐ�sÐÐÑØ!Ð˜Ð!Ð!Ñ!Ø&(Ð˜˜t™Ð(Ð(Ñ(Ø€J�ÐÐÑØ#'Ð˜SÐ'Ð'Ñ'Ø#Ð�uÐ#Ð#Ñ#Ø€L�%ÐÐÑØ€IˆtÐÐÑØ#€L�#˜‘*Ð#Ð#Ñ#Ø €L�#˜‘*Ð Ð Ñ Ø+,€L�#˜˜Sœ	‘/ DÑ(Ð,Ð,Ñ,Ø %Ð˜Ð%Ð%Ñ%Ø48€O�^ dÑ*¨TÑ1Ð8Ð8Ñ8Ø"'€N�D˜4‘KÐ'Ð'Ñ'Ø,/Ð�u˜s‘{ TÑ)Ð/Ð/Ñ/Ø&'Ð˜˜t™Ð'Ð'Ñ'Ø"€Iˆt�d‰{Ð"Ð"Ñ"Ø04€IˆtÐ&Ñ&¨Ñ-Ð4Ð4Ñ4Ø"&€N�D˜4‘KÐ&Ð&Ñ&Ø€HˆdÐÐÑð	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(r1   r4   N)r%   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   r   Ú
get_loggerr"   rO   r   r4   Ú__all__r0   r1   r2   ú<module>rc      s"  ðð $Ð #à .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,ð 
ˆÔ	˜HÑ	%Ô	%€ð €Ð2Ð3Ñ3Ô3Øð!ð !ð !ð !ð !Ð+ñ !ô !ñ „ñ 4Ô3ð!ðH €Ð2Ð3Ñ3Ô3Øð=(ð =(ð =(ð =(ð =(Ð&ñ =(ô =(ñ „ñ 4Ô3ð=(ð@ Ð4Ð
5€€€r1   