
    Z j                         S r SSKJr  SSKJr  SSKJr  SSKJrJ	r	  \	R                  " \5      r\" SS9\ " S	 S
\5      5       5       r\" SS9\ " S S\5      5       5       rSS
/rg)zchameleon model configuration    )strict   )PreTrainedConfig)RopeParameters)auto_docstringloggingzfacebook/chameleon-7b)
checkpointc                       \ rS rSr% SrSrSrSr\\	S'   Sr
\\	S'   S	r\\	S
'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Sr\\   \\S4   -  \	S'   Sr\\	S'   Sr\\   S-  \	S'   Sr\\-  \	S'   Sr\\	S'   SrSrg)ChameleonVQVAEConfig   a|  
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{Gz? )__name__
__module____qualname____firstlineno____doc__
model_typebase_config_keyr   int__annotations__r   r   boolr   r   r   r   r   listtupler   r   r   floatr!   strinitializer_range__static_attributes__r#       چ/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/chameleon/configuration_chameleon.pyr   r      s    " #J!OIsNCM4OSJKM36ES	E#s(O3ENC)-d3i$&-GUS[Isr4   r   c                     ^  \ rS rSr% SrSrS\0rS/rSr	\
\S'   Sr\
\S	'   S
r\
\S'   Sr\
\S'   Sr\
\S'   Sr\
S-  \S'   Sr\\S'   Sr\
\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\
S-  \S'   Sr\
S-  \S'   Sr\
\\
   -  S-  \S'   Sr\\S '   Sr\\ -  S-  \S!'   Sr!\S-  \S"'   S#r"\\
-  S-  \S$'   Sr#\
S-  \S%'   Sr$\S-  \S&'   Sr%\ \&-  S-  \S'   Sr'\ S-  \S''   Sr(\\S('   U 4S) jr)S*r*U =r+$ )+ChameleonConfig@   aa  
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"   r2   gh㈵>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                 Z  > U R                   c%  [        R                  S5        [        5       U l         O9[	        U R                   [
        5      (       a  [        S0 U R                   D6U l         U R                  b  U R                  R                  S5      OS U l        [        TU ](  " S0 UD6  g )NzJvq_config is None. initializing the ChameleonVQConfig with default values.z<image>r#   )r   loggerinfor   
isinstancedictrP   getimage_token_idsuper__post_init__)selfkwargs	__class__s     r5   rZ   ChameleonConfig.__post_init__v   s    >>!KKde13DN--1CDNNCDNDHDWDWDcd1155i@im''r4   )rX   r   ),r$   r%   r&   r'   r(   r)   r   sub_configskeys_to_ignore_at_inferencer;   r+   r,   r<   r=   r?   r@   rA   rC   r1   rD   r2   r0   rE   rF   r-   rG   rH   rI   r.   rJ   rK   r   rV   rL   rM   rN   rO   r   r   rP   rQ   rZ   r3   __classcell__)r]   s   @r5   r7   r7   @   sc   . J 45K#4"5JK"s"s!!&(t(J#'S'#u#L%It#L#*# L#* +,L#S	/D(, %%48O^d*T18"'ND4K',/us{T)/&'t'"Itd{"04It&&-4"&ND4K&Hd	( 	(r4   r7   N)r(   huggingface_hub.dataclassesr   configuration_utilsr   modeling_rope_utilsr   utilsr   r   
get_loggerr$   rS   r   r7   __all__r#   r4   r5   <module>rh      s    $ . 3 1 , 
		H	% 23!+ !  4!H 23=(& =(  4=(@ 4
5r4   